mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
Flutter upgrade
This commit is contained in:
parent
c921ad890a
commit
1beb18b045
505 changed files with 6657 additions and 5875 deletions
|
@ -6,7 +6,7 @@ import 'package:cake_wallet/store/dashboard/fiat_conversion_store.dart';
|
|||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
|
||||
Timer _timer;
|
||||
Timer? _timer;
|
||||
|
||||
Future<void> startFiatRateUpdate(AppStore appStore, SettingsStore settingsStore,
|
||||
FiatConversionStore fiatConversionStore) async {
|
||||
|
@ -14,19 +14,21 @@ Future<void> startFiatRateUpdate(AppStore appStore, SettingsStore settingsStore,
|
|||
return;
|
||||
}
|
||||
|
||||
fiatConversionStore.prices[appStore.wallet.currency] =
|
||||
if (appStore.wallet != null) {
|
||||
fiatConversionStore.prices[appStore.wallet!.currency] =
|
||||
await FiatConversionService.fetchPrice(
|
||||
appStore.wallet.currency, settingsStore.fiatCurrency);
|
||||
appStore.wallet!.currency, settingsStore.fiatCurrency);
|
||||
}
|
||||
|
||||
_timer = Timer.periodic(
|
||||
Duration(seconds: 30),
|
||||
(_) async {
|
||||
try {
|
||||
if (appStore.wallet.type == WalletType.haven) {
|
||||
if (appStore.wallet!.type == WalletType.haven) {
|
||||
await updateHavenRate(fiatConversionStore);
|
||||
} else {
|
||||
fiatConversionStore.prices[appStore.wallet.currency] = await FiatConversionService.fetchPrice(
|
||||
appStore.wallet.currency, settingsStore.fiatCurrency);
|
||||
fiatConversionStore.prices[appStore.wallet!.currency] = await FiatConversionService.fetchPrice(
|
||||
appStore.wallet!.currency, settingsStore.fiatCurrency);
|
||||
}
|
||||
} catch(e) {
|
||||
print(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue