Skip to content

Commit

Permalink
Merge pull request #10 from cake-tech/cyjan-fixes
Browse files Browse the repository at this point in the history
Fix issues reported after release
  • Loading branch information
OmarHatem28 authored Nov 26, 2024
2 parents 7e8172c + 8475a7d commit b81afb0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/coins/abstract.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ abstract class CoinWalletInfo {

Future<bool> checkWalletPassword(String password);

bool exists();

Future<CoinWallet> openWallet(BuildContext context,
{required String password});

Expand Down
3 changes: 3 additions & 0 deletions lib/coins/monero/coin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,7 @@ class MoneroWalletInfo extends CoinWalletInfo {
File("$walletName.keys").rename(p.join(basePath, "$newName.keys"));
_walletName = newName;
}

@override
bool exists() => File("$walletName.keys").existsSync();
}
2 changes: 1 addition & 1 deletion lib/view_model/create_wallet_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ class PinFormElement extends FormElement {
Future<void> Function(BuildContext context)? onChanged;
Future<void> Function(BuildContext context)? onConfirm;
Future<void> onConfirmInternal(BuildContext context) async {
isConfirmed = true;
await valueOutcome.encode(ctrl.text);
isConfirmed = true;
}

bool isConfirmed = false;
Expand Down
6 changes: 5 additions & 1 deletion lib/view_model/open_wallet_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ class OpenWalletViewModel extends ViewModel {
}

Future<bool> checkWalletPassword() async {
return coinInfo.checkWalletPassword(await walletPassword.value);
try {
return coinInfo.checkWalletPassword(await walletPassword.value);
} catch (e) {
return false;
}
}

Future<void> openWalletIfPasswordCorrect(BuildContext context) async {
Expand Down
7 changes: 5 additions & 2 deletions lib/view_model/security_backup_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ class SecurityBackupViewModel extends ViewModel {
},
showNumboard: true,
onConfirm: (BuildContext context) async {
await form.first.value;

try {
await form.first.value;
} catch (e) {
print(e);
}
isLocked = false;
markNeedsBuild();
})
Expand Down
1 change: 1 addition & 0 deletions lib/views/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class HomeScreen extends AbstractView {
if (config.lastWallet == null) return;
if (!context.mounted) return;
if (!viewModel.openLastWallet) return;
if (config.lastWallet?.exists() != true) return;
config.lastWallet!.openUI(context);
}
}

0 comments on commit b81afb0

Please sign in to comment.