LS client waits for socket.onopen.

ipc07
Luka Vandervelden 2019-12-23 23:48:02 +01:00
parent e8ace8a6eb
commit 1270408aca
1 changed files with 6 additions and 1 deletions

View File

@ -12,6 +12,7 @@ LoginForm = (args) ->
self = { self = {
on-login: args.on-login || -> on-login: args.on-login || ->
on-error: args.on-error || -> on-error: args.on-error || ->
schedule-render: args.schedule-render || ->
current-view: "login" current-view: "login"
enable-registration: args.enable-registration || false enable-registration: args.enable-registration || false
@ -22,7 +23,7 @@ LoginForm = (args) ->
password: "" password: ""
repeat-password: "" repeat-password: ""
} }
locked-input: false locked-input: true
error: void error: void
@ -34,6 +35,10 @@ LoginForm = (args) ->
auth-ws = AuthWS self.authws-url auth-ws = AuthWS self.authws-url
auth-ws.socket.onopen = ->
self.locked-input := false
self.schedule-render!
auth-ws.user-on-socket-error.push (...) -> auth-ws.user-on-socket-error.push (...) ->
self.error = "socket error" self.error = "socket error"
self.on-error ... self.on-error ...