Pull current online message after new web socket connection has been established.

This commit is contained in:
Martin Edenhofer 2015-08-31 10:56:00 +02:00
parent 31ab7a195f
commit afa974a5da

View file

@ -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