react-native-ota-hot-update 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,7 +57,8 @@ public class OtaHotUpdate implements ReactPackage {
57
57
  }
58
58
  String pathBundle = sharedPrefs.getString(Common.INSTANCE.getPATH());
59
59
  String currentVer = sharedPrefs.getString(Common.INSTANCE.getCURRENT_VERSION_NAME());
60
- if (pathBundle.equals("") || (info != null && !currentVer.equals("") && !latestVer.equals(currentVer))) {
60
+ if (pathBundle.equals("") || (!latestVer.equals(currentVer))) {
61
+ sharedPrefs.putString(Common.INSTANCE.getVERSION(), "");
61
62
  return Common.INSTANCE.getDEFAULT_BUNDLE();
62
63
  }
63
64
  return pathBundle;
@@ -25,6 +25,7 @@ class SharedPrefs internal constructor(context: Context) {
25
25
  }
26
26
  object Common {
27
27
  val PATH = "PATH"
28
+ val PREVIOUS_PATH = "PREVIOUS_PATH"
28
29
  val VERSION = "VERSION"
29
30
  val SHARED_PREFERENCE_NAME = "HOT-UPDATE-REACT_NATIVE"
30
31
  val CURRENT_VERSION_NAME = "CURRENT_VERSION_NAME"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ota-hot-update",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Hot update for react native",
5
5
  "main": "src/index",
6
6
  "repository": "https://github.com/vantuan88291/react-native-ota-hot-update",