diff options
| author | selsta <selsta@sent.at> | 2021-06-09 01:00:16 +0200 |
|---|---|---|
| committer | selsta <selsta@sent.at> | 2021-06-09 01:00:16 +0200 |
| commit | f75a2447a753aa8a3117dcea042589e41bd7b8d4 (patch) | |
| tree | a1367a28ecc0887d75b4fd071e881ca1d5a34c6f /js/Wizard.js | |
| parent | 2946127ed791ef8dd6dc430b681a14cd5bd2d71e (diff) | |
| download | monzero-gui-f75a2447a753aa8a3117dcea042589e41bd7b8d4.tar.gz monzero-gui-f75a2447a753aa8a3117dcea042589e41bd7b8d4.tar.xz monzero-gui-f75a2447a753aa8a3117dcea042589e41bd7b8d4.zip | |
Wizard: set unused wallet name
Diffstat (limited to 'js/Wizard.js')
| -rw-r--r-- | js/Wizard.js | 11 |
1 files changed, 11 insertions, 0 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) |
