Skip to content
Permalink
Browse files
CB-11488 (browser) Guarding code against the case when deviceready fi…
…res earlier than the plugin init on cold-start
  • Loading branch information
petermetz authored and alsorokin committed Jul 11, 2017
1 parent a18cc82 commit b0e1157c8add1427179f29a77c0fc0d609ede29a
Showing 1 changed file with 10 additions and 2 deletions.
@@ -77,6 +77,14 @@ var SplashScreen = {

localSplash.appendChild(localSplashImage);
document.body.appendChild(localSplash);

// deviceready fires earlier than the plugin init on cold-start
if (SplashScreen.shouldHideImmediately) {
SplashScreen.shouldHideImmediately = false;
window.setTimeout(function () {
SplashScreen.hide();
}, 1000);
}
}
},
hide: function () {
@@ -95,8 +103,8 @@ var SplashScreen = {
document.body.removeChild(innerLocalSplash);
innerLocalSplash = null;
}, 1000);


} else {
SplashScreen.shouldHideImmediately = true;
}
}
};

0 comments on commit b0e1157

Please sign in to comment.