Skip to content

Commit

Permalink
other necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fossephate committed Sep 24, 2024
1 parent 8faa123 commit 26267ad
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/core/sync_status_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ import 'package:cw_core/sync_status.dart';

String syncStatusTitle(SyncStatus syncStatus) {
if (syncStatus is SyncingSyncStatus) {
return syncStatus.blocksLeft == 1
? S.current.block_remaining
: S.current.Blocks_remaining('${syncStatus.blocksLeft}');
if (syncStatus.blocksLeft == 1) {
return S.current.block_remaining;
}

String eta = syncStatus.getFormattedEta() ?? '';

if (eta.isEmpty) {
return S.current.Blocks_remaining('${syncStatus.blocksLeft}');
} else {
return "${syncStatus.formattedProgress()} - $eta";
}
}

if (syncStatus is SyncedTipSyncStatus) {
Expand Down

0 comments on commit 26267ad

Please sign in to comment.