LS client waits for socket.onopen.
This commit is contained in:
parent
e8ace8a6eb
commit
1270408aca
@ -12,6 +12,7 @@ LoginForm = (args) ->
|
||||
self = {
|
||||
on-login: args.on-login || ->
|
||||
on-error: args.on-error || ->
|
||||
schedule-render: args.schedule-render || ->
|
||||
current-view: "login"
|
||||
|
||||
enable-registration: args.enable-registration || false
|
||||
@ -22,7 +23,7 @@ LoginForm = (args) ->
|
||||
password: ""
|
||||
repeat-password: ""
|
||||
}
|
||||
locked-input: false
|
||||
locked-input: true
|
||||
|
||||
error: void
|
||||
|
||||
@ -34,6 +35,10 @@ LoginForm = (args) ->
|
||||
|
||||
auth-ws = AuthWS self.authws-url
|
||||
|
||||
auth-ws.socket.onopen = ->
|
||||
self.locked-input := false
|
||||
self.schedule-render!
|
||||
|
||||
auth-ws.user-on-socket-error.push (...) ->
|
||||
self.error = "socket error"
|
||||
self.on-error ...
|
||||
|
Loading…
Reference in New Issue
Block a user