Skip to content

Commit

Permalink
fix: reset issue android cannot hot reload
Browse files Browse the repository at this point in the history
  • Loading branch information
riderx committed Apr 20, 2022
1 parent 27585e2 commit 7ad9daf
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void load() {
editor.putString("LatestVersionNative", currentVersionNative.toString());
editor.commit();
} catch (Exception ex) {
Log.e("CapacitorUpdater", "Cannot get the current version" + ex.getMessage());
Log.e("CapacitorUpdater", "Cannot get the current version " + ex.getMessage());
}
}
if (!autoUpdate || this.autoUpdateUrl.equals("")) return;
Expand Down Expand Up @@ -183,7 +183,10 @@ private boolean _reset(Boolean toAutoUpdate) {
}
implementation.reset();
String pathHot = implementation.getLastPathHot();
this.bridge.setServerAssetPath(pathHot);
if (this.bridge.getLocalServer() != null) {
// if the server is not ready yet, hot reload is not needed
this.bridge.setServerAssetPath(pathHot);
}
return true;
}

Expand Down

0 comments on commit 7ad9daf

Please sign in to comment.