Hide previous errors when clicking accept buttons

This commit is contained in:
miruka 2019-11-09 11:15:24 -04:00
parent 02888eb63d
commit 35a4030cc0
4 changed files with 12 additions and 7 deletions

View File

@ -16,7 +16,8 @@ HBox {
buttonCallbacks: ({ buttonCallbacks: ({
apply: button => { apply: button => {
button.loading = true button.loading = true
errorMessage.text = ""
let args = [ let args = [
nameField.text || null, nameField.text || null,

View File

@ -17,7 +17,8 @@ HBox {
buttonCallbacks: ({ buttonCallbacks: ({
apply: button => { apply: button => {
button.loading = true button.loading = true
errorMessage.text = ""
let args = [roomField.text] let args = [roomField.text]

View File

@ -26,7 +26,9 @@ HPage {
register: button => {}, register: button => {},
login: button => { login: button => {
button.loading = true button.loading = true
errorMessage.text = ""
let args = [ let args = [
idField.text, passwordField.text, idField.text, passwordField.text,
undefined, serverField.text, undefined, serverField.text,
@ -35,7 +37,7 @@ HPage {
py.callCoro("login_client", args, ([success, data]) => { py.callCoro("login_client", args, ([success, data]) => {
if (! success) { if (! success) {
errorMessage.text = qsTr(data) errorMessage.text = qsTr(data)
button.loading = false button.loading = false
return return
} }

View File

@ -33,9 +33,10 @@ BoxPopup {
box.buttonCallbacks: ({ box.buttonCallbacks: ({
ok: button => { ok: button => {
let password = passwordField.text let password = passwordField.text
okClicked = true okClicked = true
button.loading = true button.loading = true
errorMessage.text = ""
verifyPassword(password, result => { verifyPassword(password, result => {
if (result === true) { if (result === true) {