Merge branch 'main' of https://github.com/cake-tech/cake_wallet into CW-605-meld-buy

This commit is contained in:
Matthew Fosse 2024-04-04 09:13:35 -07:00
commit 1343417651
2 changed files with 34 additions and 16 deletions

View file

@ -1,6 +1,7 @@
import 'dart:io' show Directory, File, Platform; import 'dart:io' show Directory, File, Platform;
import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cake_wallet/entities/exchange_api_mode.dart'; import 'package:cake_wallet/entities/exchange_api_mode.dart';
import 'package:cake_wallet/entities/fiat_api_mode.dart';
import 'package:cw_core/pathForWallet.dart'; import 'package:cw_core/pathForWallet.dart';
import 'package:cake_wallet/entities/secret_store_key.dart'; import 'package:cake_wallet/entities/secret_store_key.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
@ -211,6 +212,10 @@ Future<void> defaultSettingsMigration(
await changeDefaultBitcoinNode(nodes, sharedPreferences); await changeDefaultBitcoinNode(nodes, sharedPreferences);
break; break;
case 30:
await disableServiceStatusFiatDisabled(sharedPreferences);
break;
default: default:
break; break;
} }
@ -225,6 +230,18 @@ Future<void> defaultSettingsMigration(
await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version); await sharedPreferences.setInt(PreferencesKey.currentDefaultSettingsMigrationVersion, version);
} }
Future<void> disableServiceStatusFiatDisabled(SharedPreferences sharedPreferences) async {
final currentFiat =
await sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? -1;
if (currentFiat == -1 || currentFiat == FiatApiMode.enabled.raw) {
return;
}
if (currentFiat == FiatApiMode.disabled.raw) {
await sharedPreferences.setBool(PreferencesKey.disableBulletinKey, true);
}
}
Future<void> _updateMoneroPriority(SharedPreferences sharedPreferences) async { Future<void> _updateMoneroPriority(SharedPreferences sharedPreferences) async {
final currentPriority = final currentPriority =
await sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority) ?? await sharedPreferences.getInt(PreferencesKey.moneroTransactionPriority) ??

View file

@ -163,7 +163,8 @@ Future<void> initializeAppConfigs() async {
transactionDescriptions: transactionDescriptions, transactionDescriptions: transactionDescriptions,
secureStorage: secureStorage, secureStorage: secureStorage,
anonpayInvoiceInfo: anonpayInvoiceInfo, anonpayInvoiceInfo: anonpayInvoiceInfo,
initialMigrationVersion: 29); initialMigrationVersion: 30,
);
} }
Future<void> initialSetup( Future<void> initialSetup(