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: ->
|
constructor: ->
|
||||||
super
|
super
|
||||||
|
|
||||||
|
# at runtime if a online notifiction has changed
|
||||||
@bind 'OnlineNotification::changed', =>
|
@bind 'OnlineNotification::changed', =>
|
||||||
@delay(
|
@delay(
|
||||||
=> @fetch()
|
=> @fetch()
|
||||||
1200
|
1600
|
||||||
'online-notification-changed'
|
'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
|
# rebuild widget on auth
|
||||||
@bind 'auth', (user) =>
|
@bind 'auth', (user) =>
|
||||||
if !user
|
if !user
|
||||||
|
|
Loading…
Reference in a new issue