wizardWalletInput: pick default wallet name that not exists

This commit is contained in:
plowsof 2023-02-08 23:42:16 +00:00
parent 07a2369a26
commit df7a369966
2 changed files with 3 additions and 3 deletions

View file

@ -83,10 +83,10 @@ function walletPathExists(accountsDir, directory, filename, isIOS, walletManager
return false; return false;
} }
function unusedWalletName(directory, filename, walletManager) { function unusedWalletName(directory, filename, isIOS, walletManager) {
for (var i = 0; i < 100; i++) { for (var i = 0; i < 100; i++) {
var walletName = filename + (i > 0 ? "_" + i : ""); var walletName = filename + (i > 0 ? "_" + i : "");
if (!walletManager.walletExists(directory + "/" + walletName + "/" + walletName)) { if (!walletPathExists(directory, directory, walletName, isIOS, walletManager)) {
return walletName; return walletName;
} }
} }

View file

@ -58,7 +58,7 @@ GridLayout {
walletName.error = !walletName.verify(); walletName.error = !walletName.verify();
walletLocation.error = !walletLocation.verify(); walletLocation.error = !walletLocation.verify();
walletLocation.text = appWindow.accountsDir; walletLocation.text = appWindow.accountsDir;
walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, walletManager); walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, isIOS, walletManager);
} }
MoneroComponents.LineEdit { MoneroComponents.LineEdit {