WizardRestoreWallet4, WizardCreateWallet4: disable double-click on "Create wallet" button

This commit is contained in:
rating89us 2022-01-17 21:49:11 +01:00
parent a959919b8a
commit 599033815a
3 changed files with 10 additions and 0 deletions

View file

@ -349,6 +349,8 @@ Rectangle {
const handler = function(success) { const handler = function(success) {
if (!success) { if (!success) {
appWindow.showStatusMessage(qsTr("Failed to store the wallet"), 3); appWindow.showStatusMessage(qsTr("Failed to store the wallet"), 3);
wizardStateView.wizardRestoreWallet4View.wizardNav.btnNext.enabled = true;
wizardStateView.wizardCreateWallet4View.wizardNav.btnNext.enabled = true;
return; return;
} }

View file

@ -38,6 +38,7 @@ Rectangle {
color: "transparent" color: "transparent"
property alias pageHeight: pageRoot.height property alias pageHeight: pageRoot.height
property alias wizardNav: wizardNav
property string viewName: "wizardCreateWallet4" property string viewName: "wizardCreateWallet4"
ColumnLayout { ColumnLayout {
@ -64,6 +65,7 @@ Rectangle {
WizardSummary {} WizardSummary {}
WizardNav { WizardNav {
id: wizardNav
Layout.topMargin: 24 Layout.topMargin: 24
btnNextText: qsTr("Create wallet") + translationManager.emptyString btnNextText: qsTr("Create wallet") + translationManager.emptyString
progressSteps: appWindow.walletMode <= 1 ? 3 : 4 progressSteps: appWindow.walletMode <= 1 ? 3 : 4
@ -77,11 +79,13 @@ Rectangle {
} }
} }
onNextClicked: { onNextClicked: {
btnNext.enabled = false;
wizardController.wizardStateView.wizardCreateWallet2View.pwField = ""; wizardController.wizardStateView.wizardCreateWallet2View.pwField = "";
wizardController.wizardStateView.wizardCreateWallet2View.pwConfirmField = ""; wizardController.wizardStateView.wizardCreateWallet2View.pwConfirmField = "";
wizardController.writeWallet(function() { wizardController.writeWallet(function() {
wizardController.useMoneroClicked(); wizardController.useMoneroClicked();
wizardController.walletOptionsIsRecoveringFromDevice = false; wizardController.walletOptionsIsRecoveringFromDevice = false;
btnNext.enabled = true;
}); });
} }
} }

View file

@ -38,6 +38,7 @@ Rectangle {
color: "transparent" color: "transparent"
property alias pageHeight: pageRoot.height property alias pageHeight: pageRoot.height
property alias wizardNav: wizardNav
property string viewName: "wizardRestoreWallet4" property string viewName: "wizardRestoreWallet4"
ColumnLayout { ColumnLayout {
@ -64,6 +65,7 @@ Rectangle {
WizardSummary {} WizardSummary {}
WizardNav { WizardNav {
id: wizardNav
Layout.topMargin: 24 Layout.topMargin: 24
btnNextText: qsTr("Create wallet") + translationManager.emptyString btnNextText: qsTr("Create wallet") + translationManager.emptyString
progressSteps: appWindow.walletMode <= 1 ? 3 : 4 progressSteps: appWindow.walletMode <= 1 ? 3 : 4
@ -77,11 +79,13 @@ Rectangle {
} }
} }
onNextClicked: { onNextClicked: {
btnNext.enabled = false;
wizardController.wizardStateView.wizardRestoreWallet2View.pwField = ""; wizardController.wizardStateView.wizardRestoreWallet2View.pwField = "";
wizardController.wizardStateView.wizardRestoreWallet2View.pwConfirmField = ""; wizardController.wizardStateView.wizardRestoreWallet2View.pwConfirmField = "";
wizardController.recoveryWallet(); wizardController.recoveryWallet();
wizardController.writeWallet(function() { wizardController.writeWallet(function() {
wizardController.useMoneroClicked(); wizardController.useMoneroClicked();
btnNext.enabled = true;
}); });
} }
} }