diff --git a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee index 5613532d0..240d511a7 100644 --- a/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee +++ b/app/assets/javascripts/app/controllers/widget/online_notification.js.coffee @@ -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