From e1e2f4b52ade7becf8ebd080744eff66cf3bb0b5 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Tue, 19 Jan 2021 11:17:38 +0100 Subject: [PATCH] fix(dialogs): android alert not resolving --- src/dialogs/dialogs.android.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dialogs/dialogs.android.ts b/src/dialogs/dialogs.android.ts index 65459d270..55b8c5c0f 100644 --- a/src/dialogs/dialogs.android.ts +++ b/src/dialogs/dialogs.android.ts @@ -75,7 +75,7 @@ function createAlertDialogBuilder(options?: DialogOptions & MDCAlertControlerOpt return builder; } -function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOptions & MDCAlertControlerOptions, resolve?: Function) { +function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOptions & MDCAlertControlerOptions) { if (options.titleColor) { const textViewId = dlg.getContext().getResources().getIdentifier('android:id/alertTitle', null, null); if (textViewId) { @@ -262,9 +262,9 @@ export function alert(arg: any): Promise { const alert = createAlertDialogBuilder(options); - const dlg = prepareAndCreateAlertDialog(alert, options); + const dlg = prepareAndCreateAlertDialog(alert, options, resolve); - showDialog(dlg, options, resolve); + showDialog(dlg, options); } catch (ex) { console.error(ex); reject(ex); @@ -306,7 +306,7 @@ export function confirm(arg: any): Promise { : Object.assign(defaultOptions, arg); const alert = createAlertDialogBuilder(options); const dlg = prepareAndCreateAlertDialog(alert, options, resolve); - showDialog(dlg, options, resolve); + showDialog(dlg, options); } catch (ex) { console.error(ex); reject(ex); @@ -396,7 +396,7 @@ export function prompt(arg: any): Promise { (r) => ({ result: r, text: textField.text }) ); - showDialog(dlg, options, resolve); + showDialog(dlg, options); if (!!options.autoFocus) { textField.requestFocus(); } @@ -477,7 +477,7 @@ export function login(arg: any): Promise { }, (r) => ({ result: r, userName: userNameTextField.text, password: passwordTextField.text }) ); - showDialog(dlg, options, resolve); + showDialog(dlg, options); if (!!options.autoFocus) { userNameTextField.requestFocus(); } @@ -551,7 +551,7 @@ export function action(arg: any): Promise { } resolve(r); }); - showDialog(dlg, options, resolve); + showDialog(dlg, options); } catch (ex) { console.error(ex); reject(ex);