mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-03 09:29:48 +00:00
actual fix
This commit is contained in:
parent
26ed988240
commit
ddd89bfb83
1 changed files with 8 additions and 3 deletions
|
@ -93,7 +93,8 @@ void setNotificationStarting(
|
|||
);
|
||||
}
|
||||
|
||||
void setNotificationWalletsSynced(FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async {
|
||||
void setNotificationWalletsSynced(
|
||||
FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin) async {
|
||||
flutterLocalNotificationsPlugin.cancelAll();
|
||||
setMainNotification(
|
||||
flutterLocalNotificationsPlugin,
|
||||
|
@ -250,9 +251,9 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
}
|
||||
|
||||
printV("STARTING SYNC TIMER");
|
||||
int syncedTicks = 0;
|
||||
_syncTimer?.cancel();
|
||||
_syncTimer = Timer.periodic(const Duration(milliseconds: 2000), (timer) async {
|
||||
int syncedTicks = 0;
|
||||
for (int i = 0; i < syncingWallets.length; i++) {
|
||||
final wallet = syncingWallets[i];
|
||||
final syncStatus = wallet.syncStatus;
|
||||
|
@ -280,7 +281,7 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
syncedTicks = 0;
|
||||
printV("WALLET $i SYNCED");
|
||||
try {
|
||||
wallet.stopSync();
|
||||
await wallet.stopSync();
|
||||
} catch (e) {
|
||||
printV("error stopping sync: $e");
|
||||
}
|
||||
|
@ -319,6 +320,10 @@ Future<void> onStart(ServiceInstance service) async {
|
|||
} else {
|
||||
throw Exception("sync type not covered");
|
||||
}
|
||||
|
||||
if (syncedTicks > 0) {
|
||||
content += " - Finishing up...";
|
||||
}
|
||||
} else {
|
||||
if (syncStatus is! NotConnectedSyncStatus) {
|
||||
wallet.stopSync();
|
||||
|
|
Loading…
Reference in a new issue