diff --git a/services/web/public/coffee/ide/connection/ConnectionManager.coffee b/services/web/public/coffee/ide/connection/ConnectionManager.coffee index 0791e2ddc4..3552c335df 100644 --- a/services/web/public/coffee/ide/connection/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/connection/ConnectionManager.coffee @@ -20,6 +20,12 @@ define [], () -> @disconnectIfInactive() , ONEHOUR) + # trigger a reconnect immediately if network comes back online + window.addEventListener 'online', => + sl_console.log "[online] browser notified online" + if !@connected + @tryReconnectWithRateLimit({force:true}) + @userIsLeavingPage = false window.addEventListener 'beforeunload', => @userIsLeavingPage = true