1
0

qml: wizard to check if wallet name is already used

was erroring at the very last moment previously
This commit is contained in:
SomberNight
2023-04-27 08:47:02 +00:00
parent 57ae933582
commit 87909485c5
2 changed files with 2 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ import QtQuick.Controls 2.1
import org.electrum 1.0
WizardComponent {
valid: wallet_name.text.length > 0
valid: wallet_name.text.length > 0 && !Daemon.availableWallets.wallet_name_exists(wallet_name.text)
function apply() {
wizard_data['wallet_name'] = wallet_name.text

View File

@@ -91,6 +91,7 @@ class QEWalletListModel(QAbstractListModel):
self.wallets = wallets
self.endRemoveRows()
@pyqtSlot(str, result=bool)
def wallet_name_exists(self, name):
for wallet_name, wallet_path in self.wallets:
if name == wallet_name: