react-native-update 10.25.4 → 10.26.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-update",
3
- "version": "10.25.4",
3
+ "version": "10.26.0",
4
4
  "description": "react-native hot update",
5
5
  "main": "src/index",
6
6
  "scripts": {
package/src/context.ts CHANGED
@@ -20,7 +20,7 @@ export const defaultContext = {
20
20
  };
21
21
 
22
22
  export const UpdateContext = createContext<{
23
- checkUpdate: () => Promise<void>;
23
+ checkUpdate: () => Promise<void | CheckResult>;
24
24
  switchVersion: () => Promise<void>;
25
25
  switchVersionLater: () => Promise<void>;
26
26
  markSuccess: () => void;
package/src/provider.tsx CHANGED
@@ -188,7 +188,7 @@ export const UpdateProvider = ({
188
188
  } else {
189
189
  Linking.openURL(downloadUrl);
190
190
  }
191
- return;
191
+ return info;
192
192
  }
193
193
  alertUpdate('提示', '您的应用版本已更新,点击更新下载安装新版本', [
194
194
  {
@@ -209,7 +209,7 @@ export const UpdateProvider = ({
209
209
  options.updateStrategy === 'silentAndLater'
210
210
  ) {
211
211
  downloadUpdate(info);
212
- return;
212
+ return info;
213
213
  }
214
214
  alertUpdate(
215
215
  '提示',
@@ -226,6 +226,7 @@ export const UpdateProvider = ({
226
226
  ],
227
227
  );
228
228
  }
229
+ return info;
229
230
  },
230
231
  [
231
232
  client,