Skip to content

Commit b81afb0

Browse files
authored
Merge pull request #10 from cake-tech/cyjan-fixes
Fix issues reported after release
2 parents 7e8172c + 8475a7d commit b81afb0

6 files changed

Lines changed: 17 additions & 4 deletions

File tree

lib/coins/abstract.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ abstract class CoinWalletInfo {
6161

6262
Future<bool> checkWalletPassword(String password);
6363

64+
bool exists();
65+
6466
Future<CoinWallet> openWallet(BuildContext context,
6567
{required String password});
6668

lib/coins/monero/coin.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,7 @@ class MoneroWalletInfo extends CoinWalletInfo {
400400
File("$walletName.keys").rename(p.join(basePath, "$newName.keys"));
401401
_walletName = newName;
402402
}
403+
404+
@override
405+
bool exists() => File("$walletName.keys").existsSync();
403406
}

lib/view_model/create_wallet_view_model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ class PinFormElement extends FormElement {
512512
Future<void> Function(BuildContext context)? onChanged;
513513
Future<void> Function(BuildContext context)? onConfirm;
514514
Future<void> onConfirmInternal(BuildContext context) async {
515-
isConfirmed = true;
516515
await valueOutcome.encode(ctrl.text);
516+
isConfirmed = true;
517517
}
518518

519519
bool isConfirmed = false;

lib/view_model/open_wallet_view_model.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ class OpenWalletViewModel extends ViewModel {
5050
}
5151

5252
Future<bool> checkWalletPassword() async {
53-
return coinInfo.checkWalletPassword(await walletPassword.value);
53+
try {
54+
return coinInfo.checkWalletPassword(await walletPassword.value);
55+
} catch (e) {
56+
return false;
57+
}
5458
}
5559

5660
Future<void> openWalletIfPasswordCorrect(BuildContext context) async {

lib/view_model/security_backup_view_model.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ class SecurityBackupViewModel extends ViewModel {
3131
},
3232
showNumboard: true,
3333
onConfirm: (BuildContext context) async {
34-
await form.first.value;
35-
34+
try {
35+
await form.first.value;
36+
} catch (e) {
37+
print(e);
38+
}
3639
isLocked = false;
3740
markNeedsBuild();
3841
})

lib/views/home_screen.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ class HomeScreen extends AbstractView {
161161
if (config.lastWallet == null) return;
162162
if (!context.mounted) return;
163163
if (!viewModel.openLastWallet) return;
164+
if (config.lastWallet?.exists() != true) return;
164165
config.lastWallet!.openUI(context);
165166
}
166167
}

0 commit comments

Comments
 (0)