@@ -99,34 +99,34 @@ function notifyApplicationReady() {
99
99
function sync ( options = { } ) {
100
100
return new Promise ( ( resolve , reject ) => {
101
101
checkForUpdate ( )
102
- . then ( ( remotePackage ) => {
103
- if ( ! remotePackage ) {
104
- resolve ( CodePush . SyncStatus . NO_UPDATE_AVAILABLE ) ;
105
- }
106
- else {
107
- var dialogButtons = [
108
- {
109
- text : options . updateButtonText || "Update" ,
110
- onPress : ( ) => {
111
- remotePackage . download ( )
112
- . then ( ( localPackage ) => {
113
- resolve ( CodePush . SyncStatus . APPLY_SUCCESS ) ;
114
- localPackage . apply ( options . rollbackTImeout ) ;
115
- } , reject ) ;
102
+ . then ( ( remotePackage ) => {
103
+ if ( ! remotePackage ) {
104
+ resolve ( CodePush . SyncStatus . NO_UPDATE_AVAILABLE ) ;
105
+ }
106
+ else {
107
+ var dialogButtons = [
108
+ {
109
+ text : options . updateButtonText || "Update" ,
110
+ onPress : ( ) => {
111
+ remotePackage . download ( )
112
+ . then ( ( localPackage ) => {
113
+ resolve ( CodePush . SyncStatus . APPLY_SUCCESS ) ;
114
+ localPackage . apply ( options . rollbackTimeout ) ;
115
+ } , reject ) ;
116
+ }
116
117
}
118
+ ] ;
119
+
120
+ if ( ! remotePackage . isMandatory ) {
121
+ dialogButtons . push ( {
122
+ text : options . ignoreButtonText || "Ignore" ,
123
+ onPress : ( ) => resolve ( CodePush . SyncStatus . UPDATE_IGNORED )
124
+ } ) ;
117
125
}
118
- ] ;
119
-
120
- if ( ! remotePackage . isMandatory ) {
121
- dialogButtons . push ( {
122
- text : options . ignoreButtonText || "Ignore" ,
123
- onPress : ( ) => resolve ( CodePush . SyncStatus . UPDATE_IGNORED )
124
- } ) ;
126
+
127
+ AlertIOS . alert ( options . updateTitle || "Update available" , remotePackage . description , dialogButtons ) ;
125
128
}
126
-
127
- AlertIOS . alert ( options . updateTitle || "Update available" , remotePackage . description , dialogButtons ) ;
128
- }
129
- } , reject ) ;
129
+ } , reject ) ;
130
130
} ) ;
131
131
} ;
132
132
0 commit comments