Browse Source

qml: PIN error message also when setting new pin and second entry doesn't match

patch-4
Sander van Grieken 2 years ago
parent
commit
7b17626c4c
  1. 14
      electrum/gui/qml/components/Pin.qml

14
electrum/gui/qml/components/Pin.qml

@ -49,24 +49,22 @@ ElDialog {
accepted() accepted()
else else
_phase = 1 _phase = 1
return
} else { } else {
pin.text = '' pin.text = ''
checkError = true checkError = true
} }
} } else if (_phase == 1) {
if (_phase == 1) {
_pin = pin.text _pin = pin.text
pin.text = '' pin.text = ''
_phase = 2 _phase = 2
return } else if (_phase == 2) {
}
if (_phase == 2) {
if (_pin == pin.text) { if (_pin == pin.text) {
pincode = pin.text pincode = pin.text
accepted() accepted()
} else {
pin.text = ''
checkError = true
} }
return
} }
} }
@ -140,7 +138,7 @@ ElDialog {
Label { Label {
opacity: checkError ? 1 : 0 opacity: checkError ? 1 : 0
text: qsTr('Wrong PIN') text: _phase == 0 ? qsTr('Wrong PIN') : qsTr('PIN doesn\'t match')
color: constants.colorError color: constants.colorError
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }

Loading…
Cancel
Save