react-native-update 10.19.5 → 10.19.6

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.
@@ -101,25 +101,11 @@ public class UpdateModuleImpl {
101
101
  }
102
102
  });
103
103
  }catch (Exception e){
104
- promise.reject("执行报错:"+e.getMessage());
105
- }
106
- }
107
-
108
- private void loadBundleLegacy(ReactApplicationContext mContext) {
109
- final Activity currentActivity = mContext.getCurrentActivity();
110
- if (currentActivity == null) {
111
- return;
104
+ promise.reject("执行报错:" + e.getMessage());
112
105
  }
113
-
114
- currentActivity.runOnUiThread(new Runnable() {
115
- @Override
116
- public void run() {
117
- currentActivity.recreate();
118
- }
119
- });
120
106
  }
121
107
 
122
- public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options,Promise promise) {
108
+ public static void reloadUpdate(UpdateContext updateContext, ReactApplicationContext mContext, ReadableMap options, Promise promise) {
123
109
  final String hash = options.getString("hash");
124
110
 
125
111
  if (hash == null || hash.isEmpty()) {
@@ -156,7 +142,17 @@ public class UpdateModuleImpl {
156
142
  } catch (Throwable err) {
157
143
  promise.reject(err);
158
144
  Log.e("pushy", "switchVersion failed ", err);
159
- loadBundleLegacy(mContext);
145
+ final Activity currentActivity = mContext.getCurrentActivity();
146
+ if (currentActivity == null) {
147
+ return;
148
+ }
149
+
150
+ currentActivity.runOnUiThread(new Runnable() {
151
+ @Override
152
+ public void run() {
153
+ currentActivity.recreate();
154
+ }
155
+ });
160
156
  }
161
157
  }
162
158
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.19.5",
3
+ "version": "10.19.6",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {