Skip to content

Commit

Permalink
fix: config init fail (GopeedLab#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie authored Jan 30, 2024
1 parent 39316e9 commit 8ad571a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
16 changes: 5 additions & 11 deletions ui/flutter/lib/api/model/downloader_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,14 @@ class ProxyConfig {

@JsonSerializable()
class ExtraConfigBt {
List<String> trackerSubscribeUrls;
List<String> subscribeTrackers;
bool autoUpdateTrackers;
List<String> trackerSubscribeUrls = [];
List<String> subscribeTrackers = [];
bool autoUpdateTrackers = true;
DateTime? lastTrackerUpdateTime;

List<String> customTrackers;
List<String> customTrackers = [];

ExtraConfigBt({
this.trackerSubscribeUrls = const [],
this.subscribeTrackers = const [],
this.autoUpdateTrackers = true,
this.lastTrackerUpdateTime,
this.customTrackers = const [],
});
ExtraConfigBt();

factory ExtraConfigBt.fromJson(Map<String, dynamic> json) =>
_$ExtraConfigBtFromJson(json);
Expand Down
30 changes: 13 additions & 17 deletions ui/flutter/lib/api/model/downloader_config.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions ui/flutter/lib/app/modules/setting/views/setting_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,8 @@ class SettingView extends GetView<SettingController> {
],
);
});
final buildHttpUseServerCtime = _buildConfigItem(
'useServerCtime'.tr, () => httpConfig.useServerCtime.toString(),
(Key key) {
final buildHttpUseServerCtime = _buildConfigItem('useServerCtime'.tr,
() => httpConfig.useServerCtime ? 'on'.tr : 'off'.tr, (Key key) {
return Container(
alignment: Alignment.centerLeft,
child: Switch(
Expand Down

0 comments on commit 8ad571a

Please sign in to comment.