mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
* sync status eta * other necessary changes * feat: Enhance Sync ETA display mode - Enhance block rate calculation with weighted averages(accounts for network flunctuations and sync speed of more recent blocks while calculating eta, basically giving us more accuracy) - Add option to switch between ETA and blocks remaining display in display settings - Add placeholder ETA while gathering block data * chore: Listen to smaller changes in eta --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> Co-authored-by: Blazebrain <davidadegoke16@gmail.com>
35 lines
910 B
Dart
35 lines
910 B
Dart
enum SyncStatusDisplayMode { eta, blocksRemaining }
|
|
|
|
extension SyncStatusDisplayModeExtension on SyncStatusDisplayMode {
|
|
String get title {
|
|
switch (this) {
|
|
case SyncStatusDisplayMode.eta:
|
|
return 'ETA';
|
|
case SyncStatusDisplayMode.blocksRemaining:
|
|
return 'Blocks Remaining';
|
|
}
|
|
}
|
|
|
|
String get description {
|
|
switch (this) {
|
|
case SyncStatusDisplayMode.eta:
|
|
return 'Show estimated time remaining for sync completion';
|
|
case SyncStatusDisplayMode.blocksRemaining:
|
|
return 'Show number of blocks remaining to sync';
|
|
}
|
|
}
|
|
|
|
static SyncStatusDisplayMode fromString(String value) {
|
|
switch (value) {
|
|
case 'eta':
|
|
return SyncStatusDisplayMode.eta;
|
|
case 'blocksRemaining':
|
|
return SyncStatusDisplayMode.blocksRemaining;
|
|
default:
|
|
return SyncStatusDisplayMode.eta;
|
|
}
|
|
}
|
|
|
|
String toJson() => name;
|
|
}
|