Skip to content

Commit

Permalink
Initialize nativeHttpClientAdapter to false on unsupported platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
hxdhttk authored and 3003h committed Oct 28, 2023
1 parent 9b27d35 commit 44d84ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/common/service/ehconfig_service.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:enum_to_string/enum_to_string.dart';
import 'package:fehviewer/common/controller/webdav_controller.dart';
import 'package:fehviewer/common/service/base_service.dart';
Expand Down Expand Up @@ -303,8 +305,12 @@ class EhConfigService extends ProfileService {
});

// nativeHttpClientAdapter
nativeHttpClientAdapter =
ehConfig.nativeHttpClientAdapter ?? nativeHttpClientAdapter;
if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) {
nativeHttpClientAdapter =
ehConfig.nativeHttpClientAdapter ?? nativeHttpClientAdapter;
} else {
nativeHttpClientAdapter = false;
}
everProfile<bool>(_nativeHttpClientAdapter, (val) {
ehConfig = ehConfig.copyWith(nativeHttpClientAdapter: val);
});
Expand Down

0 comments on commit 44d84ff

Please sign in to comment.