From 6b8d8003921ad62db39248f780e03d2bc7e8ffa8 Mon Sep 17 00:00:00 2001 From: Serhii Date: Sun, 14 Jul 2024 16:48:42 +0300 Subject: [PATCH] address review comments[skip ci] --- lib/store/settings_store.dart | 10 ++-------- lib/view_model/exchange/exchange_view_model.dart | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index fad9199c3..be4d4e50d 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -1521,12 +1521,7 @@ abstract class SettingsStoreBase with Store { String? serializedData = await _sharedPreferences.getString(PreferencesKey.trocadorProviderStatesKey); Map regularMap = {}; - if (serializedData != null) { - var decodedData = json.decode(serializedData); - if (decodedData is Map) { - regularMap = decodedData.map((key, value) => MapEntry(key as String, value as bool)); - } - } + if (serializedData != null) regularMap = json.decode(serializedData) as Map; trocadorProviderStates.clear(); @@ -1547,8 +1542,7 @@ abstract class SettingsStoreBase with Store { } Future saveMapToString(String key, Map map) async { - Map regularMap = Map.from(map); - String serializedData = json.encode(regularMap); + String serializedData = json.encode(map); await _sharedPreferences.setString(key, serializedData); } diff --git a/lib/view_model/exchange/exchange_view_model.dart b/lib/view_model/exchange/exchange_view_model.dart index 2f733d9ff..43468ed92 100644 --- a/lib/view_model/exchange/exchange_view_model.dart +++ b/lib/view_model/exchange/exchange_view_model.dart @@ -154,10 +154,10 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with ChangeNowExchangeProvider(settingsStore: _settingsStore), SideShiftExchangeProvider(), SimpleSwapExchangeProvider(), - TrocadorExchangeProvider(useTorOnly: _useTorOnly), ThorChainExchangeProvider(tradesStore: trades), if (FeatureFlag.isExolixEnabled) ExolixExchangeProvider(), QuantexExchangeProvider(), + TrocadorExchangeProvider(useTorOnly: _useTorOnly) ]; @observable @@ -515,7 +515,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with try { tradeState = TradeIsCreating(); if (provider is TrocadorExchangeProvider) { - await updateAllTrocadorProviderStates(provider); + updateAllTrocadorProviderStates(provider); provider.providerStates = Map.from(_settingsStore.trocadorProviderStates); }