mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Merge branch 'main' into CW-122-Rework-filter-on-the-transactions-list-screen
This commit is contained in:
@@ -31,13 +31,8 @@ abstract class TradesStoreBase with Store {
|
||||
void setTrade(Trade trade) => this.trade = trade;
|
||||
|
||||
@action
|
||||
Future<void> updateTradeList() async {
|
||||
if (trade == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
trades = tradesSource.values.map((trade) => TradeListItem(
|
||||
trade: trade!,
|
||||
settingsStore: settingsStore)).toList();
|
||||
}
|
||||
Future<void> updateTradeList() async => trades =
|
||||
tradesSource.values.map((trade) => TradeListItem(
|
||||
trade: trade,
|
||||
settingsStore: settingsStore)).toList();
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:cake_wallet/bitcoin/bitcoin.dart';
|
||||
import 'package:cake_wallet/entities/pin_code_required_duration.dart';
|
||||
import 'package:cake_wallet/entities/preferences_key.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cake_wallet/themes/theme_base.dart';
|
||||
@@ -17,7 +18,6 @@ import 'package:cw_core/node.dart';
|
||||
import 'package:cake_wallet/monero/monero.dart';
|
||||
import 'package:cake_wallet/entities/action_list_display_mode.dart';
|
||||
import 'package:cake_wallet/entities/fiat_api_mode.dart';
|
||||
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
||||
|
||||
part 'settings_store.g.dart';
|
||||
|
||||
@@ -41,6 +41,7 @@ abstract class SettingsStoreBase with Store {
|
||||
required this.shouldShowYatPopup,
|
||||
required this.isBitcoinBuyEnabled,
|
||||
required this.actionlistDisplayMode,
|
||||
required this.pinTimeOutDuration,
|
||||
TransactionPriority? initialBitcoinTransactionPriority,
|
||||
TransactionPriority? initialMoneroTransactionPriority,
|
||||
TransactionPriority? initialHavenTransactionPriority,
|
||||
@@ -141,6 +142,11 @@ abstract class SettingsStoreBase with Store {
|
||||
(String languageCode) => sharedPreferences.setString(
|
||||
PreferencesKey.currentLanguageCode, languageCode));
|
||||
|
||||
reaction(
|
||||
(_) => pinTimeOutDuration,
|
||||
(PinCodeRequiredDuration pinCodeInterval) => sharedPreferences.setInt(
|
||||
PreferencesKey.pinTimeOutDuration, pinCodeInterval.value));
|
||||
|
||||
reaction(
|
||||
(_) => balanceDisplayMode,
|
||||
(BalanceDisplayMode mode) => sharedPreferences.setInt(
|
||||
@@ -162,6 +168,7 @@ abstract class SettingsStoreBase with Store {
|
||||
|
||||
static const defaultPinLength = 4;
|
||||
static const defaultActionsMode = 11;
|
||||
static const defaultPinCodeTimeOutDuration = PinCodeRequiredDuration.tenminutes;
|
||||
|
||||
@observable
|
||||
FiatCurrency fiatCurrency;
|
||||
@@ -193,6 +200,9 @@ abstract class SettingsStoreBase with Store {
|
||||
@observable
|
||||
int pinCodeLength;
|
||||
|
||||
@observable
|
||||
PinCodeRequiredDuration pinTimeOutDuration;
|
||||
|
||||
@computed
|
||||
ThemeData get theme => currentTheme.themeData;
|
||||
|
||||
@@ -288,6 +298,11 @@ abstract class SettingsStoreBase with Store {
|
||||
sharedPreferences.getInt(PreferencesKey.displayActionListModeKey) ??
|
||||
defaultActionsMode));
|
||||
var pinLength = sharedPreferences.getInt(PreferencesKey.currentPinLength);
|
||||
final timeOutDuration = sharedPreferences.getInt(PreferencesKey.pinTimeOutDuration);
|
||||
final pinCodeTimeOutDuration = timeOutDuration != null
|
||||
? PinCodeRequiredDuration.deserialize(raw: timeOutDuration)
|
||||
: defaultPinCodeTimeOutDuration;
|
||||
|
||||
// If no value
|
||||
if (pinLength == null || pinLength == 0) {
|
||||
pinLength = defaultPinLength;
|
||||
@@ -343,6 +358,7 @@ abstract class SettingsStoreBase with Store {
|
||||
initialTheme: savedTheme,
|
||||
actionlistDisplayMode: actionListDisplayMode,
|
||||
initialPinLength: pinLength,
|
||||
pinTimeOutDuration: pinCodeTimeOutDuration,
|
||||
initialLanguageCode: savedLanguageCode,
|
||||
initialMoneroTransactionPriority: moneroTransactionPriority,
|
||||
initialBitcoinTransactionPriority: bitcoinTransactionPriority,
|
||||
|
||||
Reference in New Issue
Block a user