@@ -385,21 +385,17 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg
385
385
386
386
return await new Promise ( ( resolve , reject ) => {
387
387
let message = null ;
388
- const dialogButtons = [ {
389
- text : null ,
390
- onPress :( ) => {
391
- doDownloadAndInstall ( )
392
- . then ( resolve , reject ) ;
393
- }
394
- } ] ;
388
+ let installButtonText = null ;
389
+
390
+ const dialogButtons = [ ] ;
395
391
396
392
if ( remotePackage . isMandatory ) {
397
393
message = syncOptions . updateDialog . mandatoryUpdateMessage ;
398
- dialogButtons [ 0 ] . text = syncOptions . updateDialog . mandatoryContinueButtonLabel ;
394
+ installButtonText = syncOptions . updateDialog . mandatoryContinueButtonLabel ;
399
395
} else {
400
396
message = syncOptions . updateDialog . optionalUpdateMessage ;
401
- dialogButtons [ 0 ] . text = syncOptions . updateDialog . optionalInstallButtonLabel ;
402
- // Since this is an optional update, add another button
397
+ installButtonText = syncOptions . updateDialog . optionalInstallButtonLabel ;
398
+ // Since this is an optional update, add a button
403
399
// to allow the end-user to ignore it
404
400
dialogButtons . push ( {
405
401
text : syncOptions . updateDialog . optionalIgnoreButtonLabel ,
@@ -409,6 +405,16 @@ async function syncInternal(options = {}, syncStatusChangeCallback, downloadProg
409
405
}
410
406
} ) ;
411
407
}
408
+
409
+ // Since the install button should be placed to the
410
+ // right of any other button, add it last
411
+ dialogButtons . push ( {
412
+ text : installButtonText ,
413
+ onPress :( ) => {
414
+ doDownloadAndInstall ( )
415
+ . then ( resolve , reject ) ;
416
+ }
417
+ } )
412
418
413
419
// If the update has a description, and the developer
414
420
// explicitly chose to display it, then set that as the message
0 commit comments