Skip to content

Commit 4944b05

Browse files
committed
checkUpdate now returns info
1 parent 90d1539 commit 4944b05

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update",
3-
"version": "10.25.4",
3+
"version": "10.26.0",
44
"description": "react-native hot update",
55
"main": "src/index",
66
"scripts": {

src/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const defaultContext = {
2020
};
2121

2222
export const UpdateContext = createContext<{
23-
checkUpdate: () => Promise<void>;
23+
checkUpdate: () => Promise<void | CheckResult>;
2424
switchVersion: () => Promise<void>;
2525
switchVersionLater: () => Promise<void>;
2626
markSuccess: () => void;

src/provider.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const UpdateProvider = ({
188188
} else {
189189
Linking.openURL(downloadUrl);
190190
}
191-
return;
191+
return info;
192192
}
193193
alertUpdate('提示', '您的应用版本已更新,点击更新下载安装新版本', [
194194
{
@@ -209,7 +209,7 @@ export const UpdateProvider = ({
209209
options.updateStrategy === 'silentAndLater'
210210
) {
211211
downloadUpdate(info);
212-
return;
212+
return info;
213213
}
214214
alertUpdate(
215215
'提示',
@@ -226,6 +226,7 @@ export const UpdateProvider = ({
226226
],
227227
);
228228
}
229+
return info;
229230
},
230231
[
231232
client,

0 commit comments

Comments
 (0)