diff --git a/lib/feature/wallet/add_account/add_account_confirm/add_account_confirm_model.dart b/lib/feature/wallet/add_account/add_account_confirm/add_account_confirm_model.dart index 7e1231f50..29aa6652e 100644 --- a/lib/feature/wallet/add_account/add_account_confirm/add_account_confirm_model.dart +++ b/lib/feature/wallet/add_account/add_account_confirm/add_account_confirm_model.dart @@ -18,8 +18,12 @@ class AddAccountConfirmModel extends ElementaryModel { final NekotonRepository _nekotonRepository; Future> getAvailableBiometry(PublicKey publicKey) async { + final seed = _nekotonRepository.seedList.findSeedByAnyPublicKey(publicKey); + if (seed == null) return []; + final isBiometryEnabled = _biometryService.enabled; - final hasKeyPassword = await _biometryService.hasKeyPassword(publicKey); + final hasKeyPassword = + await _biometryService.hasKeyPassword(seed.publicKey); if (isBiometryEnabled && hasKeyPassword) { return _biometryService.getAvailableBiometry(); @@ -29,9 +33,12 @@ class AddAccountConfirmModel extends ElementaryModel { } Future requestBiometry(PublicKey publicKey) async { + final seed = _nekotonRepository.seedList.findSeedByAnyPublicKey(publicKey); + if (seed == null) return null; + try { final password = await _biometryService.getKeyPassword( - publicKey: publicKey, + publicKey: seed.publicKey, localizedReason: LocaleKeys.biometryAuthReason.tr(), ); diff --git a/lib/feature/wallet/add_account/add_account_type/add_account_type_model.dart b/lib/feature/wallet/add_account/add_account_type/add_account_type_model.dart index f3d2312d3..4e007fe81 100644 --- a/lib/feature/wallet/add_account/add_account_type/add_account_type_model.dart +++ b/lib/feature/wallet/add_account/add_account_type/add_account_type_model.dart @@ -49,7 +49,7 @@ class AddAccountTypeModel extends ElementaryModel { required PublicKey publicKey, required String password, }) async { - final seed = _nekotonRepository.seedList.findSeed(publicKey)!; + final seed = _nekotonRepository.seedList.findSeedByAnyPublicKey(publicKey)!; if (!seed.masterKey.createdAccountTypes.contains(walletType)) { return seed.masterKey;