Generic fixes (#1274)

* Display fees currency as wallet currency not the selected one

* remove unused code
catch balance network issues

* pop send screen when send completes successfully

* revert change [skip ci]

* Enable restoring haven wallets

* verify context is mounted before showing snackbar [skip ci]

* Update privacy [skip ci]

* Add user consent popup to inapp webview permission request
This commit is contained in:
Omar Hatem
2024-01-27 00:51:21 +02:00
committed by GitHub
parent aed60a7282
commit 89fdc0f4d1
36 changed files with 134 additions and 86 deletions
@@ -1,4 +1,3 @@
import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/entities/biometric_auth.dart';
import 'package:cake_wallet/entities/pin_code_required_duration.dart';
import 'package:cake_wallet/store/settings_store.dart';
@@ -9,14 +8,10 @@ part 'security_settings_view_model.g.dart';
class SecuritySettingsViewModel = SecuritySettingsViewModelBase with _$SecuritySettingsViewModel;
abstract class SecuritySettingsViewModelBase with Store {
SecuritySettingsViewModelBase(
this._settingsStore,
this._authService,
) : _biometricAuth = BiometricAuth();
SecuritySettingsViewModelBase(this._settingsStore) : _biometricAuth = BiometricAuth();
final BiometricAuth _biometricAuth;
final SettingsStore _settingsStore;
final AuthService _authService;
@computed
bool get allowBiometricalAuthentication => _settingsStore.allowBiometricalAuthentication;
@@ -41,8 +36,6 @@ abstract class SecuritySettingsViewModelBase with Store {
_settingsStore.allowBiometricalAuthentication = value;
@action
setPinCodeRequiredDuration(PinCodeRequiredDuration duration) =>
void setPinCodeRequiredDuration(PinCodeRequiredDuration duration) =>
_settingsStore.pinTimeOutDuration = duration;
Future<bool> checkPinCodeRiquired() => _authService.requireAuth();
}
@@ -1,4 +1,3 @@
import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/core/wallet_loading_service.dart';
import 'package:cake_wallet/entities/wallet_list_order_types.dart';
import 'package:hive/hive.dart';
@@ -18,7 +17,6 @@ abstract class WalletListViewModelBase with Store {
this._walletInfoSource,
this._appStore,
this._walletLoadingService,
this._authService,
) : wallets = ObservableList<WalletListItem>() {
setOrderType(_appStore.settingsStore.walletListOrder);
reaction((_) => _appStore.wallet, (_) => updateList());
@@ -39,7 +37,6 @@ abstract class WalletListViewModelBase with Store {
final AppStore _appStore;
final Box<WalletInfo> _walletInfoSource;
final WalletLoadingService _walletLoadingService;
final AuthService _authService;
WalletType get currentWalletType => _appStore.wallet!.type;
@@ -160,8 +157,4 @@ abstract class WalletListViewModelBase with Store {
break;
}
}
Future<bool> checkIfAuthRequired() async {
return _authService.requireAuth();
}
}