Skip to content

Commit

Permalink
do not show alert if no downloadurl
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnylqm committed Mar 21, 2024
1 parent fe75a2c commit b512ae1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,20 @@ export const PushyProvider = ({
setUpdateInfo(info);
if (info.expired) {
const { downloadUrl } = info;
showAlert('提示', '您的应用版本已更新,点击更新下载安装新版本', [
{
text: '更新',
onPress: () => {
if (downloadUrl) {
if (downloadUrl) {
showAlert('提示', '您的应用版本已更新,点击更新下载安装新版本', [
{
text: '更新',
onPress: () => {
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
downloadAndInstallApk(downloadUrl);
} else {
Linking.openURL(downloadUrl);
}
}
},
},
},
]);
]);
}
} else if (info.update) {
showAlert(
'提示',
Expand Down

0 comments on commit b512ae1

Please sign in to comment.