Improve checking follow updates.

This commit is contained in:
2025-02-21 13:36:14 +08:00
parent 3f10473fb6
commit bf51cd5cee
2 changed files with 36 additions and 18 deletions

View File

@@ -32,9 +32,13 @@ class DataSync with ChangeNotifier {
factory DataSync() => instance ?? (instance = DataSync._());
bool isDownloading = false;
bool _isDownloading = false;
bool isUploading = false;
bool get isDownloading => _isDownloading;
bool _isUploading = false;
bool get isUploading => _isUploading;
bool haveWaitingTask = false;
@@ -66,7 +70,7 @@ class DataSync with ChangeNotifier {
await Future.delayed(const Duration(milliseconds: 100));
}
haveWaitingTask = false;
isUploading = true;
_isUploading = true;
notifyListeners();
try {
var config = _validateConfig();
@@ -130,7 +134,7 @@ class DataSync with ChangeNotifier {
return Res.error(e.toString());
}
} finally {
isUploading = false;
_isUploading = false;
notifyListeners();
}
}
@@ -142,7 +146,7 @@ class DataSync with ChangeNotifier {
await Future.delayed(const Duration(milliseconds: 100));
}
haveWaitingTask = false;
isDownloading = true;
_isDownloading = true;
notifyListeners();
try {
var config = _validateConfig();
@@ -205,7 +209,7 @@ class DataSync with ChangeNotifier {
return Res.error(e.toString());
}
} finally {
isDownloading = false;
_isDownloading = false;
notifyListeners();
}
}