Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 1da068f

Browse files
committed
Move React require to top
1 parent babb3c2 commit 1da068f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

CodePush.ios.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var NativeCodePush = require('react-native').NativeModules.CodePush;
1010
var requestFetchAdapter = require("./request-fetch-adapter.js");
1111
var Sdk = require("code-push/script/acquisition-sdk").AcquisitionManager;
1212
var packageMixins = require("./package-mixins")(NativeCodePush);
13+
var { AlertIOS } = require("react-native");
1314

1415
// This function is only used for tests. Replaces the default SDK, configuration and native bridge
1516
function setUpTestDependencies(providedTestSdk, providedTestConfig, testNativeBridge){
@@ -105,7 +106,7 @@ function sync(options = {}) {
105106
else {
106107
var dialogButtons = [
107108
{
108-
text: options.downloadButtonText || "Download",
109+
text: options.updateButtonText || "Update",
109110
onPress: () => {
110111
remotePackage.download()
111112
.then((localPackage) => {
@@ -118,12 +119,12 @@ function sync(options = {}) {
118119

119120
if (!remotePackage.isMandatory) {
120121
dialogButtons.push({
121-
text: options.cancelButtonText || "Cancel",
122+
text: options.cancelButtonText || "Ignore",
122123
onPress: () => resolve(CodePush.SyncStatus.USER_CANCELLED)
123124
});
124125
}
125126

126-
React.AlertIOS.alert(options.title || "Update available", remotePackage.description, dialogButtons);
127+
AlertIOS.alert(options.title || "Update available", remotePackage.description, dialogButtons);
127128
}
128129
}, reject);
129130
});
@@ -138,8 +139,8 @@ var CodePush = {
138139
sync: sync,
139140
SyncStatus: {
140141
NO_UPDATE_AVAILABLE: 0,
141-
APPLY_SUCCESS: 1,
142-
USER_CANCELLED: 2
142+
USER_CANCELLED: 1,
143+
APPLY_SUCCESS: 2
143144
}
144145
};
145146

0 commit comments

Comments
 (0)