- Fix reloading settings store

- Revert changes to backup_service.dart
This commit is contained in:
OmarHatem 2022-12-07 16:41:04 +02:00
parent d961a4645e
commit c235df8935
4 changed files with 31 additions and 53 deletions

View file

@ -1,7 +1,6 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
@ -21,7 +20,7 @@ import 'package:cake_backup/backup.dart' as cake_backup;
class BackupService {
BackupService(this._flutterSecureStorage, this._walletInfoSource,
this._keyService, this._sharedPreferences, this._settingsStore)
this._keyService, this._sharedPreferences)
: _cipher = Cryptography.instance.chacha20Poly1305Aead(),
_correctWallets = <WalletInfo>[];
@ -34,7 +33,6 @@ class BackupService {
final FlutterSecureStorage _flutterSecureStorage;
final SharedPreferences _sharedPreferences;
final Box<WalletInfo> _walletInfoSource;
final SettingsStore _settingsStore;
final KeyService _keyService;
List<WalletInfo> _correctWallets;
@ -303,7 +301,6 @@ class BackupService {
as Map<String, dynamic>;
final keychainWalletsInfo = keychainJSON['wallets'] as List;
final decodedPin = keychainJSON['pin'] as String;
_settingsStore.pinCodeLength = decodedPin.length;
final pinCodeKey = generateStoreKeyFor(key: SecretStoreKey.pinCodePassword);
final backupPasswordKey =
generateStoreKeyFor(key: SecretStoreKey.backupPassword);
@ -334,7 +331,6 @@ class BackupService {
final keychainWalletsInfo = keychainJSON['wallets'] as List;
final decodedPin = keychainJSON['pin'] as String;
final pinCodeKey = generateStoreKeyFor(key: SecretStoreKey.pinCodePassword);
_settingsStore.pinCodeLength = decodedPin.length;
final backupPasswordKey =
generateStoreKeyFor(key: SecretStoreKey.backupPassword);
final backupPassword = keychainJSON[backupPasswordKey] as String;