mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-03 14:53:10 +08:00
bump version to 10.31.0-beta.0 and integrate i18n for improved localization support
This commit is contained in:
@@ -120,16 +120,16 @@ export const UpdateProvider = ({
|
||||
client.switchVersionLater(hash);
|
||||
return true;
|
||||
}
|
||||
alertUpdate('提示', '下载完毕,是否立即更新?', [
|
||||
alertUpdate(client.t('alert_title'), client.t('alert_update_ready'), [
|
||||
{
|
||||
text: '下次再说',
|
||||
text: client.t('alert_next_time'),
|
||||
style: 'cancel',
|
||||
onPress: () => {
|
||||
client.switchVersionLater(hash);
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '立即更新',
|
||||
text: client.t('alert_update_now'),
|
||||
style: 'default',
|
||||
onPress: () => {
|
||||
client.switchVersion(hash);
|
||||
@@ -139,7 +139,7 @@ export const UpdateProvider = ({
|
||||
return true;
|
||||
} catch (e: any) {
|
||||
setLastError(e);
|
||||
alertError('更新失败', e.message);
|
||||
alertError(client.t('update_failed'), e.message);
|
||||
throwErrorIfEnabled(e);
|
||||
return false;
|
||||
}
|
||||
@@ -168,7 +168,7 @@ export const UpdateProvider = ({
|
||||
rootInfo = await client.checkUpdate(extra);
|
||||
} catch (e: any) {
|
||||
setLastError(e);
|
||||
alertError('更新检查失败', e.message);
|
||||
alertError(client.t('error_update_check_failed'), e.message);
|
||||
throwErrorIfEnabled(e);
|
||||
return;
|
||||
}
|
||||
@@ -211,21 +211,25 @@ export const UpdateProvider = ({
|
||||
}
|
||||
return info;
|
||||
}
|
||||
alertUpdate('提示', '您的应用版本已更新,点击更新下载安装新版本', [
|
||||
{
|
||||
text: '更新',
|
||||
onPress: () => {
|
||||
if (
|
||||
Platform.OS === 'android' &&
|
||||
downloadUrl.endsWith('.apk')
|
||||
) {
|
||||
downloadAndInstallApk(downloadUrl);
|
||||
} else {
|
||||
Linking.openURL(downloadUrl);
|
||||
}
|
||||
alertUpdate(
|
||||
client.t('alert_title'),
|
||||
client.t('alert_app_updated'),
|
||||
[
|
||||
{
|
||||
text: client.t('alert_update_button'),
|
||||
onPress: () => {
|
||||
if (
|
||||
Platform.OS === 'android' &&
|
||||
downloadUrl.endsWith('.apk')
|
||||
) {
|
||||
downloadAndInstallApk(downloadUrl);
|
||||
} else {
|
||||
Linking.openURL(downloadUrl);
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
],
|
||||
);
|
||||
}
|
||||
} else if (info.update) {
|
||||
if (
|
||||
@@ -236,12 +240,15 @@ export const UpdateProvider = ({
|
||||
return info;
|
||||
}
|
||||
alertUpdate(
|
||||
'提示',
|
||||
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
|
||||
client.t('alert_title'),
|
||||
client.t('alert_new_version_found', {
|
||||
name: info.name,
|
||||
description: info.description,
|
||||
}),
|
||||
[
|
||||
{ text: '取消', style: 'cancel' },
|
||||
{ text: client.t('alert_cancel'), style: 'cancel' },
|
||||
{
|
||||
text: '确定',
|
||||
text: client.t('alert_confirm'),
|
||||
style: 'default',
|
||||
onPress: () => {
|
||||
downloadUpdate();
|
||||
@@ -313,8 +320,8 @@ export const UpdateProvider = ({
|
||||
checkUpdate({ extra: { toHash: payload.data } }).then(() => {
|
||||
if (updateInfoRef.current && updateInfoRef.current.upToDate) {
|
||||
Alert.alert(
|
||||
'Info',
|
||||
'No update found, please wait 10s for the server to generate the patch package',
|
||||
client.t('alert_info'),
|
||||
client.t('alert_no_update_wait'),
|
||||
);
|
||||
}
|
||||
options.logger = logger;
|
||||
@@ -324,7 +331,7 @@ export const UpdateProvider = ({
|
||||
}
|
||||
return false;
|
||||
},
|
||||
[checkUpdate, options],
|
||||
[checkUpdate, options, client],
|
||||
);
|
||||
|
||||
const parseTestQrCode = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user