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
|
-
|
|
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
|
});
|