Pull current online message after new web socket connection has been established.
This commit is contained in:
parent
31ab7a195f
commit
afa974a5da
1 changed files with 13 additions and 1 deletions
|
@ -5,13 +5,25 @@ class App.OnlineNotificationWidget extends App.Controller
|
|||
constructor: ->
|
||||
super
|
||||
|
||||
# at runtime if a online notifiction has changed
|
||||
@bind 'OnlineNotification::changed', =>
|
||||
@delay(
|
||||
=> @fetch()
|
||||
1200
|
||||
1600
|
||||
'online-notification-changed'
|
||||
)
|
||||
|
||||
# after new websocket connection has been established
|
||||
@ignoreInitLogin = false
|
||||
@bind 'ws:login', =>
|
||||
if @ignoreInitLogin
|
||||
@delay(
|
||||
=> @fetch()
|
||||
3200
|
||||
'online-notification-changed'
|
||||
)
|
||||
@ignoreInitLogin = true
|
||||
|
||||
# rebuild widget on auth
|
||||
@bind 'auth', (user) =>
|
||||
if !user
|
||||
|
|
Loading…
Reference in a new issue