mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-09-16 10:21:37 +08:00
checkUpdate now returns info
This commit is contained in:
@@ -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": {
|
||||||
|
@@ -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;
|
||||||
|
@@ -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,
|
||||||
|
Reference in New Issue
Block a user