Sync when app resumes

This commit is contained in:
Hanh 2021-10-11 10:15:14 +08:00
parent aedabeed9f
commit 1ae000a4e6
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'dart:ui';
import 'dart:math';
@ -385,7 +386,8 @@ class _AccountPageState extends State<AccountPage>
}
_setupTimer() async {
await _sync();
await Future.delayed(Duration(seconds: 3));
await _trySync();
_timerSync = Timer.periodic(Duration(seconds: 15), (Timer t) {
_trySync();
});
@ -395,8 +397,6 @@ class _AccountPageState extends State<AccountPage>
return priceStore.zecPrice;
}
_sync() async {}
_trySync() async {
priceStore.fetchZecPrice();
if (syncStatus.syncedHeight < 0) return;