mirror of
https://codeberg.org/anoncontributorxmr/mysu.git
synced 2024-11-25 08:52:28 +00:00
Display error string on wallet creation fail
This commit is contained in:
parent
b1f8552628
commit
c4d012be69
2 changed files with 6 additions and 2 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,4 +96,5 @@
|
|||
<string name="selected_utxos_value">Selected value: %1$s XMR</string>
|
||||
<string name="global_index_text">Global Idx: %1$d</string>
|
||||
<string name="outpoint_text">Outpoint: %1$s</string>
|
||||
<string name="create_wallet_failed">Create wallet failed: %1$s</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue