Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions packages/core/ui/dialogs/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ function addButtonsToAlertController(alertController: UIAlertController, options
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, false);
})
}),
);
}

if (isString(options.neutralButtonText)) {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.neutralButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, undefined);
})
}),
);
}

if (isString(options.okButtonText)) {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, true);
})
);
const action = UIAlertAction.actionWithTitleStyleHandler(options.okButtonText, UIAlertActionStyle.Default, () => {
raiseCallback(callback, true);
});
alertController.addAction(action);
alertController.preferredAction = action; // Allows using keyboard enter/return to confirm the dialog
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ export function alert(arg: any): Promise<void> {
title: DialogStrings.ALERT,
okButtonText: DialogStrings.OK,
message: arg + '',
}
}
: arg;
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);

Expand All @@ -115,7 +115,7 @@ export function confirm(arg: any): Promise<boolean> {
okButtonText: DialogStrings.OK,
cancelButtonText: DialogStrings.CANCEL,
message: arg + '',
}
}
: arg;
const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);

Expand Down Expand Up @@ -301,7 +301,7 @@ export function action(...args): Promise<string> {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(action, dialogType, (arg: UIAlertAction) => {
resolve(arg.title);
})
}),
);
}
}
Expand All @@ -311,7 +311,7 @@ export function action(...args): Promise<string> {
alertController.addAction(
UIAlertAction.actionWithTitleStyleHandler(options.cancelButtonText, UIAlertActionStyle.Cancel, (arg: UIAlertAction) => {
resolve(arg.title);
})
}),
);
}

Expand Down