Skip to content

Commit 6c07aa7

Browse files
committed
Update version to 10.36.6 in package.json and simplify version change checks in UpdateContext.java
1 parent 536b548 commit 6c07aa7

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

android/src/main/java/cn/reactnative/modules/update/UpdateContext.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,9 @@ public UpdateContext(Context context) {
4646

4747

4848
SharedPreferences.Editor editor = this.sp.edit();
49-
if (storedPackageVersion == null) {
50-
editor.putString("packageVersion", packageVersion);
51-
editor.apply();
52-
storedPackageVersion = packageVersion;
53-
}
54-
55-
if (storedBuildTime == null) {
56-
editor.putString("buildTime", buildTime);
57-
editor.apply();
58-
storedBuildTime = buildTime;
59-
}
6049

61-
boolean packageVersionChanged = !packageVersion.equals(storedPackageVersion);
62-
boolean buildTimeChanged = !buildTime.equals(storedBuildTime);
50+
boolean packageVersionChanged = storedPackageVersion == null || !packageVersion.equals(storedPackageVersion);
51+
boolean buildTimeChanged = storedBuildTime == null || !buildTime.equals(storedBuildTime);
6352

6453
if (packageVersionChanged || buildTimeChanged) {
6554
// Execute cleanUp before clearing SharedPreferences to avoid race condition

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update",
3-
"version": "10.36.5",
3+
"version": "10.36.6",
44
"description": "react-native hot update",
55
"main": "src/index",
66
"scripts": {

0 commit comments

Comments
 (0)