2021-12-24 12:52:08 +00:00
|
|
|
import 'package:cake_wallet/generated/i18n.dart';
|
|
|
|
import 'package:cw_core/sync_status.dart';
|
|
|
|
|
|
|
|
String syncStatusTitle(SyncStatus syncStatus) {
|
|
|
|
if (syncStatus is SyncingSyncStatus) {
|
2024-02-26 18:32:54 +00:00
|
|
|
return syncStatus.blocksLeft == 1
|
2024-02-26 18:33:31 +00:00
|
|
|
? S.current.block_remaining
|
2024-02-26 18:32:54 +00:00
|
|
|
: S.current.Blocks_remaining('${syncStatus.blocksLeft}');
|
2021-12-24 12:52:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (syncStatus is SyncedSyncStatus) {
|
|
|
|
return S.current.sync_status_syncronized;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (syncStatus is NotConnectedSyncStatus) {
|
|
|
|
return S.current.sync_status_not_connected;
|
|
|
|
}
|
|
|
|
|
2022-11-09 10:14:21 +00:00
|
|
|
if (syncStatus is AttemptingSyncStatus) {
|
|
|
|
return S.current.sync_status_attempting_sync;
|
2021-12-24 12:52:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2022-10-12 17:09:57 +00:00
|
|
|
|
2024-02-27 14:40:56 +00:00
|
|
|
if (syncStatus is UnsupportedSyncStatus) {
|
|
|
|
return S.current.sync_status_unsupported;
|
|
|
|
}
|
|
|
|
|
2024-03-11 12:46:20 +00:00
|
|
|
if (syncStatus is TimedOutSyncStatus) {
|
|
|
|
return S.current.sync_status_timed_out;
|
|
|
|
}
|
|
|
|
|
2024-04-17 19:35:11 +00:00
|
|
|
if (syncStatus is SyncronizingSyncStatus) {
|
|
|
|
return S.current.sync_status_syncronizing;
|
|
|
|
}
|
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
return '';
|
2024-02-26 18:32:54 +00:00
|
|
|
}
|