mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-09 20:53:47 +01:00
Display error string on wallet creation fail
This commit is contained in:
parent
b1f8552628
commit
c4d012be69
@ -109,7 +109,7 @@ public class OnboardingFragment extends Fragment {
|
|||||||
wallet = WalletManager.getInstance().createWallet(walletFile, walletPassword, Constants.MNEMONIC_LANGUAGE, restoreHeight);
|
wallet = WalletManager.getInstance().createWallet(walletFile, walletPassword, Constants.MNEMONIC_LANGUAGE, restoreHeight);
|
||||||
} else {
|
} else {
|
||||||
if (!checkMnemonic(walletSeed)) {
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (!restoreHeightText.isEmpty()) {
|
if (!restoreHeightText.isEmpty()) {
|
||||||
@ -117,12 +117,15 @@ public class OnboardingFragment extends Fragment {
|
|||||||
}
|
}
|
||||||
wallet = WalletManager.getInstance().recoveryWallet(walletFile, walletPassword, walletSeed, "", restoreHeight);
|
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.
|
walletFile.delete(); // cache is broken for some reason when recovering wallets. delete the file here. this happens in monerujo too.
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
mainActivity.init(walletFile, walletPassword);
|
mainActivity.init(walletFile, walletPassword);
|
||||||
mainActivity.runOnUiThread(mainActivity::onBackPressed);
|
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="selected_utxos_value">Selected value: %1$s XMR</string>
|
||||||
<string name="global_index_text">Global Idx: %1$d</string>
|
<string name="global_index_text">Global Idx: %1$d</string>
|
||||||
<string name="outpoint_text">Outpoint: %1$s</string>
|
<string name="outpoint_text">Outpoint: %1$s</string>
|
||||||
|
<string name="create_wallet_failed">Create wallet failed: %1$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user