mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-11-05 07:43:11 +08:00
translate
This commit is contained in:
@@ -44,7 +44,7 @@ export class Pushy {
|
|||||||
|
|
||||||
constructor(options: PushyOptions) {
|
constructor(options: PushyOptions) {
|
||||||
if (!options.appKey) {
|
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)) {
|
for (const [key, value] of Object.entries(options)) {
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
|
|||||||
@@ -67,14 +67,14 @@ export const PushyProvider = ({
|
|||||||
stateListener.current && stateListener.current.remove();
|
stateListener.current && stateListener.current.remove();
|
||||||
showAlert('Download complete', 'Do you want to apply the update now?', [
|
showAlert('Download complete', 'Do you want to apply the update now?', [
|
||||||
{
|
{
|
||||||
text: 'Later',
|
text: '下次再说',
|
||||||
style: 'cancel',
|
style: 'cancel',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
client.switchVersionLater(hash);
|
client.switchVersionLater(hash);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'Now',
|
text: '立即更新',
|
||||||
style: 'default',
|
style: 'default',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
client.switchVersion(hash);
|
client.switchVersion(hash);
|
||||||
@@ -106,7 +106,7 @@ export const PushyProvider = ({
|
|||||||
'A full update is required to download and install to continue.',
|
'A full update is required to download and install to continue.',
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
text: 'OK',
|
text: '更新',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
if (downloadUrl) {
|
if (downloadUrl) {
|
||||||
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
|
if (Platform.OS === 'android' && downloadUrl.endsWith('.apk')) {
|
||||||
@@ -121,14 +121,12 @@ export const PushyProvider = ({
|
|||||||
);
|
);
|
||||||
} else if ('update' in info) {
|
} else if ('update' in info) {
|
||||||
showAlert(
|
showAlert(
|
||||||
`Version ${info.name} available`,
|
'提示',
|
||||||
`What's new\n
|
'检查到新的版本' + info.name + ',是否下载?\n' + info.description,
|
||||||
${info.description}
|
|
||||||
`,
|
|
||||||
[
|
[
|
||||||
{ text: 'Cancel', style: 'cancel' },
|
{ text: '取消', style: 'cancel' },
|
||||||
{
|
{
|
||||||
text: 'OK',
|
text: '确定',
|
||||||
style: 'default',
|
style: 'default',
|
||||||
onPress: () => {
|
onPress: () => {
|
||||||
doUpdate(info as UpdateAvailableResult);
|
doUpdate(info as UpdateAvailableResult);
|
||||||
|
|||||||
Reference in New Issue
Block a user