1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

translate

This commit is contained in:
sunnylqm 2024-01-18 00:32:21 +08:00
parent 9d93faab31
commit e5405b4977
No known key found for this signature in database
2 changed files with 8 additions and 10 deletions

View File

@ -44,7 +44,7 @@ export class Pushy {
constructor(options: PushyOptions) {
if (!options.appKey) {
throw new Error('appKey is required for withUpdates()');
throw new Error('appKey is required');
}
for (const [key, value] of Object.entries(options)) {
if (value !== undefined) {

View File

@ -67,14 +67,14 @@ export const PushyProvider = ({
stateListener.current && stateListener.current.remove();
showAlert('Download complete', 'Do you want to apply the update now?', [
{
text: 'Later',
text: '下次再说',
style: 'cancel',
onPress: () => {
client.switchVersionLater(hash);
},
},
{
text: 'Now',
text: '立即更新',
style: 'default',
onPress: () => {
client.switchVersion(hash);
@ -106,7 +106,7 @@ export const PushyProvider = ({
'A full update is required to download and install to continue.',
[
{
text: 'OK',
text: '更新',
onPress: () => {
if (downloadUrl) {
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
@ -121,14 +121,12 @@ export const PushyProvider = ({
);
} else if ('update' in info) {
showAlert(
`Version ${info.name} available`,
`What's new\n
${info.description}
`,
'提示',
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
[
{ text: 'Cancel', style: 'cancel' },
{ text: '取消', style: 'cancel' },
{
text: 'OK',
text: '确定',
style: 'default',
onPress: () => {
doUpdate(info as UpdateAvailableResult);