Merge branch 'master' of https://github.com/reactnativecn/react-native-pushy
This commit is contained in:
commit
1f83593072
@ -174,16 +174,20 @@ public class UpdateContext {
|
|||||||
currentVersion = this.rollBack();
|
currentVersion = this.rollBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (currentVersion == null) {
|
||||||
|
return defaultAssetsUrl;
|
||||||
|
}
|
||||||
return (new File(rootDir, currentVersion+"/index.bundlejs").toString());
|
return (new File(rootDir, currentVersion+"/index.bundlejs").toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String rollBack() {
|
private String rollBack() {
|
||||||
String lastVersion = sp.getString("lastVersion", null);
|
String lastVersion = sp.getString("lastVersion", null);
|
||||||
if (lastVersion == null) {
|
|
||||||
throw new Error("This should never happen");
|
|
||||||
}
|
|
||||||
SharedPreferences.Editor editor = sp.edit();
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
if (lastVersion == null) {
|
||||||
|
editor.remove("currentVersion");
|
||||||
|
} else {
|
||||||
editor.putString("currentVersion", lastVersion);
|
editor.putString("currentVersion", lastVersion);
|
||||||
|
}
|
||||||
editor.putBoolean("firstTimeOk", true);
|
editor.putBoolean("firstTimeOk", true);
|
||||||
editor.putBoolean("firstTime", false);
|
editor.putBoolean("firstTime", false);
|
||||||
editor.putBoolean("rolledBack", true);
|
editor.putBoolean("rolledBack", true);
|
||||||
|
Loading…
Reference in New Issue
Block a user