mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-12 17:08:58 +08:00
Fixing typo and spacing
This commit is contained in:
@@ -99,34 +99,34 @@ function notifyApplicationReady() {
|
||||
function sync(options = {}) {
|
||||
return new Promise((resolve, reject) => {
|
||||
checkForUpdate()
|
||||
.then((remotePackage) => {
|
||||
if (!remotePackage) {
|
||||
resolve(CodePush.SyncStatus.NO_UPDATE_AVAILABLE);
|
||||
}
|
||||
else {
|
||||
var dialogButtons = [
|
||||
{
|
||||
text: options.updateButtonText || "Update",
|
||||
onPress: () => {
|
||||
remotePackage.download()
|
||||
.then((localPackage) => {
|
||||
resolve(CodePush.SyncStatus.APPLY_SUCCESS);
|
||||
localPackage.apply(options.rollbackTImeout);
|
||||
}, reject);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
if (!remotePackage.isMandatory) {
|
||||
dialogButtons.push({
|
||||
text: options.ignoreButtonText || "Ignore",
|
||||
onPress: () => resolve(CodePush.SyncStatus.UPDATE_IGNORED)
|
||||
});
|
||||
.then((remotePackage) => {
|
||||
if (!remotePackage) {
|
||||
resolve(CodePush.SyncStatus.NO_UPDATE_AVAILABLE);
|
||||
}
|
||||
|
||||
AlertIOS.alert(options.updateTitle || "Update available", remotePackage.description, dialogButtons);
|
||||
}
|
||||
}, reject);
|
||||
else {
|
||||
var dialogButtons = [
|
||||
{
|
||||
text: options.updateButtonText || "Update",
|
||||
onPress: () => {
|
||||
remotePackage.download()
|
||||
.then((localPackage) => {
|
||||
resolve(CodePush.SyncStatus.APPLY_SUCCESS);
|
||||
localPackage.apply(options.rollbackTimeout);
|
||||
}, reject);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
if (!remotePackage.isMandatory) {
|
||||
dialogButtons.push({
|
||||
text: options.ignoreButtonText || "Ignore",
|
||||
onPress: () => resolve(CodePush.SyncStatus.UPDATE_IGNORED)
|
||||
});
|
||||
}
|
||||
|
||||
AlertIOS.alert(options.updateTitle || "Update available", remotePackage.description, dialogButtons);
|
||||
}
|
||||
}, reject);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user