From 9b041dbe1ead0f66eb7bd51ccd5456888ace00f0 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Mon, 4 Jan 2021 17:13:37 +0200 Subject: [PATCH] CAKE-222 | fixed transaction priority picker on the settings screen; added check of priority for wallet type --- lib/view_model/settings/settings_view_model.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/view_model/settings/settings_view_model.dart b/lib/view_model/settings/settings_view_model.dart index 983438b6c..4f43d528a 100644 --- a/lib/view_model/settings/settings_view_model.dart +++ b/lib/view_model/settings/settings_view_model.dart @@ -35,6 +35,14 @@ abstract class SettingsViewModelBase with Store { currentVersion = ''; PackageInfo.fromPlatform().then( (PackageInfo packageInfo) => currentVersion = packageInfo.version); + + final priority = _settingsStore.transactionPriority; + + if (!TransactionPriority.forWalletType(_walletType).contains(priority)) { + _settingsStore.transactionPriority = + TransactionPriority.forWalletType(_walletType).first; + } + sections = [ [ if ((wallet.balance.availableModes as List).length > 1) @@ -55,7 +63,8 @@ abstract class SettingsViewModelBase with Store { title: S.current.settings_fee_priority, items: TransactionPriority.forWalletType(wallet.type), selectedItem: () => transactionPriority, - isAlwaysShowScrollThumb: true, + isAlwaysShowScrollThumb: + TransactionPriority.forWalletType(wallet.type).length > 3, onItemSelected: (TransactionPriority priority) => _settingsStore.transactionPriority = priority), SwitcherListItem(