alert fixed

This commit is contained in:
Vladimir Enchev
2015-11-27 14:56:11 +02:00
parent 2eec961f9e
commit c3d3326cb2
5 changed files with 41 additions and 4 deletions

View File

@@ -85,7 +85,7 @@ function addButtonsToAlertDialog(alert: android.app.AlertDialog.Builder, options
export function alert(arg: any): Promise<void> {
return new Promise<void>((resolve, reject) => {
try {
var options = types.isString(arg) ? { title: dialogsCommon.ALERT, okButtonText: dialogsCommon.OK, message: arg } : arg;
var options = !dialogsCommon.isDialogOptions(arg) ? { title: dialogsCommon.ALERT, okButtonText: dialogsCommon.OK, message: arg + "" } : arg;
var alert = createAlertDialog(options);
@@ -112,7 +112,7 @@ export function alert(arg: any): Promise<void> {
export function confirm(arg: any): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
try {
var options = types.isString(arg) ? { title: dialogsCommon.CONFIRM, okButtonText: dialogsCommon.OK, cancelButtonText: dialogsCommon.CANCEL, message: arg } : arg;
var options = !dialogsCommon.isDialogOptions(arg) ? { title: dialogsCommon.CONFIRM, okButtonText: dialogsCommon.OK, cancelButtonText: dialogsCommon.CANCEL, message: arg + "" } : arg;
var alert = createAlertDialog(options);
addButtonsToAlertDialog(alert, options, function (result) { resolve(result); });