Login errors are now displayed, although crudely.

This commit is contained in:
Luka Vandervelden 2019-10-26 19:02:25 +02:00
parent 04a3d5119a
commit 10891d193d

View File

@ -512,6 +512,8 @@ socket.on-message = (event) ->
when "user" when "user"
if message.user if message.user
model.users[message.user.uid] := message.user model.users[message.user.uid] := message.user
when "login-error"
model.login-error = message.error
else else
console.log "RECEIVED UNKNOWN MESSAGE TYPE: #{message.type}" console.log "RECEIVED UNKNOWN MESSAGE TYPE: #{message.type}"
@ -544,6 +546,10 @@ renderer = ->
when "login" when "login"
h \div.container [ h \div.container [
h \div.box [ h \div.box [
if model.login-error
h \div.notification.is-danger [
model.login-error
]
h \form [ h \form [
bulma.field [ bulma.field [
bulma.label "Login" bulma.label "Login"
@ -569,6 +575,7 @@ renderer = ->
onclick: (e) -> onclick: (e) ->
e.prevent-default! e.prevent-default!
model.login-error = undefined
socket.login model.login, model.password socket.login model.login, model.password
} [ "Letsu go!" ] } [ "Letsu go!" ]
] ]