1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 10:21:37 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

checkUpdate now returns info

This commit is contained in:
sunnylqm
2025-03-05 20:17:06 +08:00
parent 90d1539038
commit 4944b05378
3 changed files with 5 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "react-native-update", "name": "react-native-update",
"version": "10.25.4", "version": "10.26.0",
"description": "react-native hot update", "description": "react-native hot update",
"main": "src/index", "main": "src/index",
"scripts": { "scripts": {

View File

@@ -20,7 +20,7 @@ export const defaultContext = {
}; };
export const UpdateContext = createContext<{ export const UpdateContext = createContext<{
checkUpdate: () => Promise<void>; checkUpdate: () => Promise<void | CheckResult>;
switchVersion: () => Promise<void>; switchVersion: () => Promise<void>;
switchVersionLater: () => Promise<void>; switchVersionLater: () => Promise<void>;
markSuccess: () => void; markSuccess: () => void;

View File

@@ -188,7 +188,7 @@ export const UpdateProvider = ({
} else { } else {
Linking.openURL(downloadUrl); Linking.openURL(downloadUrl);
} }
return; return info;
} }
alertUpdate('提示', '您的应用版本已更新,点击更新下载安装新版本', [ alertUpdate('提示', '您的应用版本已更新,点击更新下载安装新版本', [
{ {
@@ -209,7 +209,7 @@ export const UpdateProvider = ({
options.updateStrategy === 'silentAndLater' options.updateStrategy === 'silentAndLater'
) { ) {
downloadUpdate(info); downloadUpdate(info);
return; return info;
} }
alertUpdate( alertUpdate(
'提示', '提示',
@@ -226,6 +226,7 @@ export const UpdateProvider = ({
], ],
); );
} }
return info;
}, },
[ [
client, client,