mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-10-31 17:37:41 +00:00
bbba41396d
* refactor: remove bitcoin_flutter, update deps, electrs node improvements * feat: connecting/disconnecting improvements, fix rescan by date, scanning message * chore: print * Update pubspec.yaml * Update pubspec.yaml * handle null sockets, retry connection on connect failure * fix imports * fix transaction history * fix RBF * minor fixes/readability enhancements [skip ci] --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> Co-authored-by: Matthew Fosse <matt@fosse.co>
60 lines
1.5 KiB
Dart
60 lines
1.5 KiB
Dart
import 'package:cake_wallet/generated/i18n.dart';
|
|
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 is SyncedTipSyncStatus) {
|
|
return S.current.silent_payments_scanned_tip(syncStatus.tip.toString());
|
|
}
|
|
|
|
if (syncStatus is SyncedSyncStatus) {
|
|
return S.current.sync_status_syncronized;
|
|
}
|
|
|
|
if (syncStatus is NotConnectedSyncStatus) {
|
|
return S.current.sync_status_not_connected;
|
|
}
|
|
|
|
if (syncStatus is AttemptingSyncStatus) {
|
|
return S.current.sync_status_attempting_sync;
|
|
}
|
|
|
|
if (syncStatus is FailedSyncStatus) {
|
|
return S.current.sync_status_failed_connect;
|
|
}
|
|
|
|
if (syncStatus is ConnectingSyncStatus) {
|
|
return S.current.sync_status_connecting;
|
|
}
|
|
|
|
if (syncStatus is ConnectedSyncStatus) {
|
|
return S.current.sync_status_connected;
|
|
}
|
|
|
|
if (syncStatus is LostConnectionSyncStatus) {
|
|
return S.current.sync_status_failed_connect;
|
|
}
|
|
|
|
if (syncStatus is UnsupportedSyncStatus) {
|
|
return S.current.sync_status_unsupported;
|
|
}
|
|
|
|
if (syncStatus is TimedOutSyncStatus) {
|
|
return S.current.sync_status_timed_out;
|
|
}
|
|
|
|
if (syncStatus is SyncronizingSyncStatus) {
|
|
return S.current.sync_status_syncronizing;
|
|
}
|
|
|
|
if (syncStatus is StartingScanSyncStatus) {
|
|
return S.current.sync_status_starting_scan;
|
|
}
|
|
|
|
return '';
|
|
}
|