Fixes for update fiat rate after change of current wallet type. Fixes for change amount for btc transactions. Changed displaying of balance for btc wallet. General fixes.

This commit is contained in:
M
2020-12-15 18:29:10 +02:00
parent eede39ee7a
commit 8cb9bd15cd
29 changed files with 340 additions and 276 deletions
+6
View File
@@ -26,4 +26,10 @@ abstract class AppStoreBase with Store {
SettingsStore settingsStore;
NodeListStore nodeListStore;
@action
void changeCurrentWallet(WalletBase wallet) {
this.wallet?.close();
this.wallet = wallet;
}
}
@@ -1,13 +1,13 @@
import 'package:cake_wallet/entities/crypto_currency.dart';
import 'package:mobx/mobx.dart';
part 'fiat_conversion_store.g.dart';
class FiatConversionStore = FiatConversionStoreBase
with _$FiatConversionStore;
class FiatConversionStore = FiatConversionStoreBase with _$FiatConversionStore;
abstract class FiatConversionStoreBase with Store {
FiatConversionStoreBase() : price = 0.0;
FiatConversionStoreBase() : prices = ObservableMap<CryptoCurrency, double>();
@observable
double price;
ObservableMap<CryptoCurrency, double> prices;
}
+4 -7
View File
@@ -43,7 +43,6 @@ abstract class SettingsStoreBase with Store {
isDarkTheme = initialDarkTheme;
pinCodeLength = initialPinLength;
languageCode = initialLanguageCode;
currentNode = nodes[WalletType.monero];
this.nodes = ObservableMap<WalletType, Node>.of(nodes);
_sharedPreferences = sharedPreferences;
@@ -80,13 +79,14 @@ abstract class SettingsStoreBase with Store {
(int pinLength) => sharedPreferences.setInt(
PreferencesKey.currentPinLength, pinLength));
reaction((_) => currentNode,
(Node node) => _saveCurrentNode(node, WalletType.monero));
reaction(
(_) => languageCode,
(String languageCode) => sharedPreferences.setString(
PreferencesKey.currentLanguageCode, languageCode));
this
.nodes
.observe((change) => _saveCurrentNode(change.newValue, change.key));
}
static const defaultPinLength = 4;
@@ -116,9 +116,6 @@ abstract class SettingsStoreBase with Store {
@observable
int pinCodeLength;
@observable
Node currentNode;
@computed
ThemeData get theme => isDarkTheme ? Themes.darkTheme : Themes.lightTheme;