Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(EWM-282): add account bugs #521

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ class AddAccountConfirmModel extends ElementaryModel {
final NekotonRepository _nekotonRepository;

Future<List<BiometricType>> 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();
Expand All @@ -29,9 +33,12 @@ class AddAccountConfirmModel extends ElementaryModel {
}

Future<String?> 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(),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading