mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-14 20:33:41 +00:00
refactor(ui): refine advanced options and settings feedback (#1661)
This commit is contained in:
30 files changed
+243
-68
No files matched your search
@@ -625,7 +625,6 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
),
|
||||
SettingsItem(
|
||||
title: context.l10n.enableDht,
|
||||
subtitle: context.l10n.restartRequired,
|
||||
child: shad.Switch(
|
||||
value: !config.protocolConfig.bt.disableDht,
|
||||
onChanged: (value) => _mutateConfig((next) => next.protocolConfig.bt.disableDht = !value),
|
||||
@@ -633,7 +632,6 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
),
|
||||
SettingsItem(
|
||||
title: context.l10n.enablePex,
|
||||
subtitle: context.l10n.restartRequired,
|
||||
child: shad.Switch(
|
||||
value: !config.protocolConfig.bt.disablePex,
|
||||
onChanged: (value) => _mutateConfig((next) => next.protocolConfig.bt.disablePex = !value),
|
||||
@@ -1204,7 +1202,10 @@ class _SettingsPageState extends ConsumerState<SettingsPage> {
|
||||
final snapshot = DownloaderConfig.fromJson(config.toJson());
|
||||
_loadedSignature = _signature(snapshot);
|
||||
try {
|
||||
await ref.read(settingsControllerProvider.notifier).save(snapshot);
|
||||
final result = await ref.read(settingsControllerProvider.notifier).save(snapshot);
|
||||
if (mounted && result.btRestartRequired) {
|
||||
_toast(context.l10n.restartRequired, type: AppToastType.info);
|
||||
}
|
||||
return true;
|
||||
} catch (error) {
|
||||
if (mounted) _toast(error.toString());
|
||||
|
||||
Reference in new issue
Block a user