mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-18 16:17:03 +00:00
GODT-2167: bind sign-in buttons availability to loading state.
This commit is contained in:
@ -260,7 +260,7 @@ FocusScope {
|
|||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
id: signInButton
|
id: signInButton
|
||||||
text: loading ? qsTr("Signing in") : qsTr("Sign in")
|
text: loading ? qsTr("Signing in") : qsTr("Sign in")
|
||||||
|
enabled: !loading
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
||||||
@ -278,7 +278,6 @@ FocusScope {
|
|||||||
usernameTextField.enabled = false
|
usernameTextField.enabled = false
|
||||||
passwordTextField.enabled = false
|
passwordTextField.enabled = false
|
||||||
|
|
||||||
enabled = false
|
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
Backend.login(usernameTextField.text, Qt.btoa(passwordTextField.text))
|
Backend.login(usernameTextField.text, Qt.btoa(passwordTextField.text))
|
||||||
@ -357,7 +356,7 @@ FocusScope {
|
|||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
id: twoFAButton
|
id: twoFAButton
|
||||||
text: loading ? qsTr("Authenticating") : qsTr("Authenticate")
|
text: loading ? qsTr("Authenticating") : qsTr("Authenticate")
|
||||||
|
enabled: !loading
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
|
|
||||||
@ -369,10 +368,7 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
twoFactorPasswordTextField.enabled = false
|
twoFactorPasswordTextField.enabled = false
|
||||||
|
|
||||||
enabled = false
|
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
Backend.login2FA(usernameTextField.text, Qt.btoa(twoFactorPasswordTextField.text))
|
Backend.login2FA(usernameTextField.text, Qt.btoa(twoFactorPasswordTextField.text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -425,6 +421,7 @@ FocusScope {
|
|||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
id: secondPasswordButton
|
id: secondPasswordButton
|
||||||
text: loading ? qsTr("Unlocking") : qsTr("Unlock")
|
text: loading ? qsTr("Unlocking") : qsTr("Unlock")
|
||||||
|
enabled: !loading
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 24
|
Layout.topMargin: 24
|
||||||
@ -437,10 +434,7 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
secondPasswordTextField.enabled = false
|
secondPasswordTextField.enabled = false
|
||||||
|
|
||||||
enabled = false
|
|
||||||
loading = true
|
loading = true
|
||||||
|
|
||||||
Backend.login2Password(usernameTextField.text, Qt.btoa(secondPasswordTextField.text))
|
Backend.login2Password(usernameTextField.text, Qt.btoa(secondPasswordTextField.text))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user