@@ -62,17 +62,17 @@ function addButtonsToAlertDialog(alert: UIAlertView, options: dialogs.ConfirmOpt
6262 return ;
6363 }
6464
65- if ( options . okButtonText ) {
66- alert . addButtonWithTitle ( options . okButtonText ) ;
67- }
68-
6965 if ( options . cancelButtonText ) {
7066 alert . addButtonWithTitle ( options . cancelButtonText ) ;
7167 }
7268
7369 if ( options . neutralButtonText ) {
7470 alert . addButtonWithTitle ( options . neutralButtonText ) ;
7571 }
72+
73+ if ( options . okButtonText ) {
74+ alert . addButtonWithTitle ( options . okButtonText ) ;
75+ }
7676}
7777
7878function addButtonsToAlertController ( alertController : UIAlertController , options : dialogs . ConfirmOptions ,
@@ -81,14 +81,6 @@ function addButtonsToAlertController(alertController: UIAlertController, options
8181 return ;
8282 }
8383
84- if ( types . isString ( options . okButtonText ) ) {
85- alertController . addAction ( UIAlertAction . actionWithTitleStyleHandler ( options . okButtonText , UIAlertActionStyle . UIAlertActionStyleDefault , ( arg : UIAlertAction ) => {
86- if ( types . isFunction ( okCallback ) ) {
87- okCallback ( ) ;
88- }
89- } ) ) ;
90- }
91-
9284 if ( types . isString ( options . cancelButtonText ) ) {
9385 alertController . addAction ( UIAlertAction . actionWithTitleStyleHandler ( options . cancelButtonText , UIAlertActionStyle . UIAlertActionStyleDefault , ( arg : UIAlertAction ) => {
9486 if ( types . isFunction ( cancelCallback ) ) {
@@ -104,6 +96,14 @@ function addButtonsToAlertController(alertController: UIAlertController, options
10496 }
10597 } ) ) ;
10698 }
99+
100+ if ( types . isString ( options . okButtonText ) ) {
101+ alertController . addAction ( UIAlertAction . actionWithTitleStyleHandler ( options . okButtonText , UIAlertActionStyle . UIAlertActionStyleDefault , ( arg : UIAlertAction ) => {
102+ if ( types . isFunction ( okCallback ) ) {
103+ okCallback ( ) ;
104+ }
105+ } ) ) ;
106+ }
107107}
108108
109109export function alert ( arg : any ) : Promise < void > {
0 commit comments