Login errors are now displayed, although crudely.
This commit is contained in:
parent
04a3d5119a
commit
10891d193d
@ -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!" ]
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user