diff --git a/lib/core/utils/sync/icloud.dart b/lib/core/utils/sync/icloud.dart index 8928c161..255d76e9 100644 --- a/lib/core/utils/sync/icloud.dart +++ b/lib/core/utils/sync/icloud.dart @@ -17,12 +17,12 @@ abstract final class ICloud { /// Upload file to iCloud /// - /// - [relativePath] is the path relative to [docDir], + /// - [relativePath] is the path relative to [Paths.doc], /// must not starts with `/` /// - [localPath] has higher priority than [relativePath], but only apply /// to the local path instead of iCloud path /// - /// Return `null` if upload success, `ICloudErr` otherwise + /// Return [null] if upload success, [ICloudErr] otherwise static Future upload({ required String relativePath, String? localPath, @@ -70,12 +70,12 @@ abstract final class ICloud { /// Download file from iCloud /// - /// - [relativePath] is the path relative to [docDir], + /// - [relativePath] is the path relative to [Paths.doc], /// must not starts with `/` /// - [localPath] has higher priority than [relativePath], but only apply /// to the local path instead of iCloud path /// - /// Return `null` if upload success, `ICloudErr` otherwise + /// Return `null` if upload success, [ICloudErr] otherwise static Future download({ required String relativePath, String? localPath, @@ -105,12 +105,12 @@ abstract final class ICloud { /// Sync file between iCloud and local /// - /// - [relativePath] is the path relative to [docDir], + /// - [relativePaths] is the path relative to [Paths.doc], /// must not starts with `/` - /// - [bakSuffix] is the suffix of backup file, default to [null]. - /// All files downloaded from cloud will be suffixed with [bakSuffix]. + /// - [bakPrefix] is the suffix of backup file, default to [null]. + /// All files downloaded from cloud will be suffixed with [bakPrefix]. /// - /// Return `null` if upload success, `ICloudErr` otherwise + /// Return `null` if upload success, [ICloudErr] otherwise static Future> syncFiles({ required Iterable relativePaths, String? bakPrefix, diff --git a/lib/data/provider/server.dart b/lib/data/provider/server.dart index 5fb3d3c1..6f3b45a9 100644 --- a/lib/data/provider/server.dart +++ b/lib/data/provider/server.dart @@ -149,8 +149,6 @@ class ServerProvider extends ChangeNotifier { return await _getData(s.spi); } - static final refreshKey = GlobalKey(); - Future startAutoRefresh() async { var duration = Stores.setting.serverStatusUpdateInterval.fetch(); stopAutoRefresh(); @@ -159,7 +157,6 @@ class ServerProvider extends ChangeNotifier { duration = 3; Loggers.app.warning('Invalid duration: $duration, use default 3'); } - refreshKey.currentState?.show(); _timer = Timer.periodic(Duration(seconds: duration), (_) async { await refresh(); }); diff --git a/lib/view/page/server/tab.dart b/lib/view/page/server/tab.dart index f6d97e17..b8086524 100644 --- a/lib/view/page/server/tab.dart +++ b/lib/view/page/server/tab.dart @@ -105,7 +105,6 @@ class _ServerPageState extends State if (isDesktop) return child; return RefreshIndicator( - key: ServerProvider.refreshKey, onRefresh: () async => await Pros.server.refresh(onlyFailed: true), child: child, );