aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/Wizard.js11
-rw-r--r--wizard/WizardWalletInput.qml2
2 files changed, 12 insertions, 1 deletions
diff --git a/js/Wizard.js b/js/Wizard.js
index 61ac105d..76b41864 100644
--- a/js/Wizard.js
+++ b/js/Wizard.js
@@ -82,6 +82,17 @@ function walletPathExists(accountsDir, directory, filename, isIOS, walletManager
return false;
}
+function unusedWalletName(directory, filename, walletManager) {
+ for (var i = 0; i < 100; i++) {
+ var walletName = filename + (i > 0 ? "_" + i : "");
+ if (!walletManager.walletExists(directory + "/" + walletName + "/" + walletName)) {
+ return walletName;
+ }
+ }
+
+ return filename;
+}
+
function isAscii(str){
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 127)
diff --git a/wizard/WizardWalletInput.qml b/wizard/WizardWalletInput.qml
index e754a4f1..6d62df3e 100644
--- a/wizard/WizardWalletInput.qml
+++ b/wizard/WizardWalletInput.qml
@@ -56,7 +56,7 @@ GridLayout {
walletName.error = !walletName.verify();
walletLocation.error = walletLocation.text === "";
walletLocation.text = appWindow.accountsDir;
- walletName.text = defaultAccountName;
+ walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, walletManager);
}
MoneroComponents.LineEdit {