From b512ae18b78103c807f996b7a97ccbf82e232d84 Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Thu, 21 Mar 2024 22:11:09 +0800 Subject: [PATCH] do not show alert if no downloadurl --- src/provider.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/provider.tsx b/src/provider.tsx index 0f09ed4..d6294f2 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -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( '提示',