mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-03 17:39:54 +00:00
Merge pull request #3544
f75a244
Wizard: set unused wallet name (selsta)
This commit is contained in:
commit
0b0bc87184
2 changed files with 12 additions and 1 deletions
11
js/Wizard.js
11
js/Wizard.js
|
@ -82,6 +82,17 @@ function walletPathExists(accountsDir, directory, filename, isIOS, walletManager
|
||||||
return false;
|
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){
|
function isAscii(str){
|
||||||
for (var i = 0; i < str.length; i++) {
|
for (var i = 0; i < str.length; i++) {
|
||||||
if (str.charCodeAt(i) > 127)
|
if (str.charCodeAt(i) > 127)
|
||||||
|
|
|
@ -57,7 +57,7 @@ GridLayout {
|
||||||
walletName.error = !walletName.verify();
|
walletName.error = !walletName.verify();
|
||||||
walletLocation.error = walletLocation.text === "";
|
walletLocation.error = walletLocation.text === "";
|
||||||
walletLocation.text = appWindow.accountsDir;
|
walletLocation.text = appWindow.accountsDir;
|
||||||
walletName.text = defaultAccountName;
|
walletName.text = Wizard.unusedWalletName(appWindow.accountsDir, defaultAccountName, walletManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroComponents.LineEdit {
|
MoneroComponents.LineEdit {
|
||||||
|
|
Loading…
Reference in a new issue