From d852546fd24b0389f2a33febe24710a9e8c6b8ab Mon Sep 17 00:00:00 2001 From: Hanh Date: Wed, 20 Jul 2022 22:58:44 +0800 Subject: [PATCH] Bug fixes to sync status --- lib/account.dart | 5 +++-- lib/store.dart | 1 + pubspec.yaml | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/account.dart b/lib/account.dart index f849519..07bd681 100644 --- a/lib/account.dart +++ b/lib/account.dart @@ -62,6 +62,7 @@ class SyncStatusState extends State { if (simpleMode) Padding(padding: EdgeInsets.fromLTRB(0, 8, 0, 0), child: Text(s.simpleMode)), Observer(builder: (context) { final time = eta.eta; + final synced = syncStatus.isSynced(); final syncedHeight = syncStatus.syncedHeight; final timestamp = syncStatus.timestamp?.timeAgo() ?? s.na; final latestHeight = syncStatus.latestHeight; @@ -98,13 +99,13 @@ class SyncStatusState extends State { final text = latestHeight == 0 ? Text(s.disconnected) : syncedHeight == null ? Text(s.rescanNeeded) - : syncStatus.isSynced() + : synced ? Text('$syncedHeight', style: theme.textTheme.caption) : GestureDetector( onTap: () => setState(() { display += 1; }), child: createSyncStatus()); - return TextButton(onPressed: () => _onSync(context), child: text); + return TextButton(onPressed: synced ? () => _onSync(context) : null, child: text); }) ]); } diff --git a/lib/store.dart b/lib/store.dart index 1538443..7681c37 100644 --- a/lib/store.dart +++ b/lib/store.dart @@ -629,6 +629,7 @@ abstract class _SyncStatus with Store { eta.reset(); showSnackBar(S.of(context).rescanRequested(height)); syncedHeight = height; + timestamp = null; WarpApi.truncateData(); WarpApi.rewindToHeight(height); await sync(); diff --git a/pubspec.yaml b/pubspec.yaml index 35709f0..9b6cbad 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.11+258 +version: 1.2.12+260 environment: sdk: ">=2.12.0 <3.0.0"