react-native-update 7.3.1 → 7.3.8

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.
package/lib/main.js CHANGED
@@ -227,7 +227,7 @@ export async function downloadUpdate(options, eventListeners) {
227
227
  } catch (e) {
228
228
  progressHandler && progressHandler.remove();
229
229
  report(options.hash, 'error');
230
- return;
230
+ throw e;
231
231
  }
232
232
  }
233
233
  } else if (options.pdiffUrl) {
@@ -240,7 +240,7 @@ export async function downloadUpdate(options, eventListeners) {
240
240
  } catch (e) {
241
241
  progressHandler && progressHandler.remove();
242
242
  report(options.hash, 'error');
243
- return;
243
+ throw e;
244
244
  }
245
245
  }
246
246
  setLocalHashInfo(options.hash, {
@@ -36,12 +36,15 @@ export function simpleUpdate(WrappedComponent) {
36
36
  this.checkUpdate();
37
37
  }
38
38
  componentWillUnmount() {
39
- this.stateListener.remove();
39
+ this.stateListener && this.stateListener.remove();
40
40
  }
41
41
  doUpdate = async (info) => {
42
42
  try {
43
43
  const hash = await downloadUpdate(info);
44
- this.stateListener.remove();
44
+ if (!hash) {
45
+ return;
46
+ }
47
+ this.stateListener && this.stateListener.remove();
45
48
  Alert.alert('提示', '下载完毕,是否立即更新?', [
46
49
  {
47
50
  text: '以后再说',
@@ -91,7 +94,7 @@ export function simpleUpdate(WrappedComponent) {
91
94
  },
92
95
  },
93
96
  ]);
94
- } else {
97
+ } else if (info.update) {
95
98
  Alert.alert(
96
99
  '提示',
97
100
  '检查到新的版本' + info.name + ',是否下载?\n' + info.description,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "7.3.1",
3
+ "version": "7.3.8",
4
4
  "description": "react-native hot update",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -28,6 +28,6 @@
28
28
  },
29
29
  "homepage": "https://github.com/reactnativecn/react-native-pushy#readme",
30
30
  "dependencies": {
31
- "nanoid": "^3.1.28"
31
+ "nanoid": "^3.1.30"
32
32
  }
33
33
  }