Browse code

BM-13299 Fix: Initialize online status (sometime online event is triggered before app bootstrap)

Mehdi Rande authored on 03/07/2018 08:36:21
Showing 1 changed files
... ...
@@ -132,8 +132,9 @@ net.bluemind.mvp.Application.prototype.bootstrap = function(ctx) {
132 132
   goog.events.listen(online, ['online', 'offline'], function(state) {
133 133
     ctx.online = state.type == 'online';
134 134
   });
135
+  ctx.online = online.isOnline();
135 136
   var waitForConnection = new goog.Promise(function(resolve) {
136
-    if (!ctx.privacy) {
137
+    if (!ctx.privacy && !ctx.online) {
137 138
       goog.log.warning(this.logger, "Public mode, we must wait to be online to proceed");
138 139
       goog.events.listenOnce(online, 'online', resolve);
139 140
     } else {