From 7b17626c4c58c0b32b26f2043d371a35a4806d23 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Wed, 24 Aug 2022 16:21:14 +0200 Subject: [PATCH] qml: PIN error message also when setting new pin and second entry doesn't match --- electrum/gui/qml/components/Pin.qml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/electrum/gui/qml/components/Pin.qml b/electrum/gui/qml/components/Pin.qml index 761c22c7c..62ca09d7a 100644 --- a/electrum/gui/qml/components/Pin.qml +++ b/electrum/gui/qml/components/Pin.qml @@ -49,24 +49,22 @@ ElDialog { accepted() else _phase = 1 - return } else { pin.text = '' checkError = true } - } - if (_phase == 1) { + } else if (_phase == 1) { _pin = pin.text pin.text = '' _phase = 2 - return - } - if (_phase == 2) { + } else if (_phase == 2) { if (_pin == pin.text) { pincode = pin.text accepted() + } else { + pin.text = '' + checkError = true } - return } } @@ -140,7 +138,7 @@ ElDialog { Label { opacity: checkError ? 1 : 0 - text: qsTr('Wrong PIN') + text: _phase == 0 ? qsTr('Wrong PIN') : qsTr('PIN doesn\'t match') color: constants.colorError Layout.alignment: Qt.AlignHCenter }