diff --git a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
index 7ba31e2..3b532ff 100644
--- a/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
+++ b/app/src/main/java/net/mynero/wallet/fragment/onboarding/OnboardingFragment.java
@@ -109,7 +109,7 @@ public class OnboardingFragment extends Fragment {
wallet = WalletManager.getInstance().createWallet(walletFile, walletPassword, Constants.MNEMONIC_LANGUAGE, restoreHeight);
} else {
if (!checkMnemonic(walletSeed)) {
- Toast.makeText(getContext(), getString(R.string.invalid_mnemonic_code), Toast.LENGTH_SHORT).show();
+ Toast.makeText(mainActivity, getString(R.string.invalid_mnemonic_code), Toast.LENGTH_SHORT).show();
return;
}
if (!restoreHeightText.isEmpty()) {
@@ -117,12 +117,15 @@ public class OnboardingFragment extends Fragment {
}
wallet = WalletManager.getInstance().recoveryWallet(walletFile, walletPassword, walletSeed, "", restoreHeight);
}
- boolean ok = wallet.getStatus().isOk();
+ Wallet.Status walletStatus = wallet.getStatus();
+ boolean ok = walletStatus.isOk();
walletFile.delete(); // cache is broken for some reason when recovering wallets. delete the file here. this happens in monerujo too.
if (ok) {
mainActivity.init(walletFile, walletPassword);
mainActivity.runOnUiThread(mainActivity::onBackPressed);
+ } else {
+ Toast.makeText(mainActivity, getString(R.string.create_wallet_failed, walletStatus.getErrorString()), Toast.LENGTH_SHORT).show();
}
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4d9040f..56dd22f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -96,4 +96,5 @@
Selected value: %1$s XMR
Global Idx: %1$d
Outpoint: %1$s
+ Create wallet failed: %1$s