Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
Fix for #93 .
Browse files Browse the repository at this point in the history
  • Loading branch information
nikDemyankov committed Jan 20, 2016
1 parent 51f7d5a commit a35e9d0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class HotCodePushPlugin extends CordovaPlugin {

private Handler handler;
private boolean isPluginReadyForWork;
private boolean dontReloadOnStart;

// region Plugin lifecycle

Expand Down Expand Up @@ -103,7 +104,7 @@ public void initialize(final CordovaInterface cordova, final CordovaWebView webV
public void onStart() {
super.onStart();

EventBus eventBus = EventBus.getDefault();
final EventBus eventBus = EventBus.getDefault();
if (!eventBus.isRegistered(this)) {
eventBus.register(this);
}
Expand All @@ -112,11 +113,15 @@ public void onStart() {
// if not - install it
isPluginReadyForWork = isPluginReadyForWork();
if (!isPluginReadyForWork) {
dontReloadOnStart = true;
installWwwFolder();
return;
}

redirectToLocalStorageIndexPage();
// reload only if we on local storage
if (!dontReloadOnStart && webView.getUrl().startsWith(LOCAL_ASSETS_FOLDER)) {
redirectToLocalStorageIndexPage();
}

// install update if there is anything to install
if (chcpXmlConfig.isAutoInstallIsAllowed() &&
Expand Down

0 comments on commit a35e9d0

Please sign in to comment.