diff --git a/lib/data/model/app/backup.dart b/lib/data/model/app/backup.dart index 99b47bbd0..d88d9ff20 100644 --- a/lib/data/model/app/backup.dart +++ b/lib/data/model/app/backup.dart @@ -7,6 +7,8 @@ import 'package:toolbox/data/model/server/server_private_info.dart'; import 'package:toolbox/data/model/server/snippet.dart'; import 'package:toolbox/data/res/logger.dart'; import 'package:toolbox/data/res/path.dart'; +import 'package:toolbox/data/res/provider.dart'; +import 'package:toolbox/data/res/rebuild.dart'; import 'package:toolbox/data/res/store.dart'; const backupFormatVersion = 1; @@ -103,6 +105,10 @@ class Backup { Stores.docker.put(k, val); } } + + Pros.reload(); + RebuildNodes.app.rebuild(); + return true; } diff --git a/lib/view/page/backup.dart b/lib/view/page/backup.dart index ced7cb195..9c9d2bb4f 100644 --- a/lib/view/page/backup.dart +++ b/lib/view/page/backup.dart @@ -13,8 +13,6 @@ import 'package:toolbox/core/utils/sync/webdav.dart'; import 'package:toolbox/data/model/app/backup.dart'; import 'package:toolbox/data/res/logger.dart'; import 'package:toolbox/data/res/path.dart'; -import 'package:toolbox/data/res/provider.dart'; -import 'package:toolbox/data/res/rebuild.dart'; import 'package:toolbox/data/res/store.dart'; import 'package:toolbox/view/widget/expand_tile.dart'; import 'package:toolbox/view/widget/cardx.dart'; @@ -120,7 +118,6 @@ class BackupPage extends StatelessWidget { onPressed: () async { await backup.restore(force: true); context.pop(); - _reload(); }, child: Text(l10n.ok), ), @@ -162,7 +159,6 @@ class BackupPage extends StatelessWidget { icloudLoading.value = true; await ICloud.sync(); icloudLoading.value = false; - _reload(); } }, ), @@ -202,7 +198,6 @@ class BackupPage extends StatelessWidget { await compute(Backup.fromJsonString, dlFile); await dlBak.restore(force: true); icloudLoading.value = false; - _reload(); }, child: Text(l10n.download), ), @@ -329,7 +324,6 @@ class BackupPage extends StatelessWidget { webdavLoading.value = true; await Webdav.sync(); webdavLoading.value = false; - _reload(); } }, ), @@ -370,7 +364,6 @@ class BackupPage extends StatelessWidget { await compute(Backup.fromJsonString, dlFile); await dlBak.restore(force: true); webdavLoading.value = false; - _reload(); }, child: Text(l10n.download), ), @@ -400,9 +393,4 @@ class BackupPage extends StatelessWidget { ), ); } - - void _reload() { - Pros.reload(); - RebuildNodes.app.rebuild(); - } }