Skip to content

Commit e1e2f4b

Browse files
committed
fix(dialogs): android alert not resolving
1 parent 3835976 commit e1e2f4b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: src/dialogs/dialogs.android.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function createAlertDialogBuilder(options?: DialogOptions & MDCAlertControlerOpt
7575
return builder;
7676
}
7777

78-
function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOptions & MDCAlertControlerOptions, resolve?: Function) {
78+
function showDialog(dlg: androidx.appcompat.app.AlertDialog, options: DialogOptions & MDCAlertControlerOptions) {
7979
if (options.titleColor) {
8080
const textViewId = dlg.getContext().getResources().getIdentifier('android:id/alertTitle', null, null);
8181
if (textViewId) {
@@ -262,9 +262,9 @@ export function alert(arg: any): Promise<void> {
262262

263263
const alert = createAlertDialogBuilder(options);
264264

265-
const dlg = prepareAndCreateAlertDialog(alert, options);
265+
const dlg = prepareAndCreateAlertDialog(alert, options, resolve);
266266

267-
showDialog(dlg, options, resolve);
267+
showDialog(dlg, options);
268268
} catch (ex) {
269269
console.error(ex);
270270
reject(ex);
@@ -306,7 +306,7 @@ export function confirm(arg: any): Promise<boolean> {
306306
: Object.assign(defaultOptions, arg);
307307
const alert = createAlertDialogBuilder(options);
308308
const dlg = prepareAndCreateAlertDialog(alert, options, resolve);
309-
showDialog(dlg, options, resolve);
309+
showDialog(dlg, options);
310310
} catch (ex) {
311311
console.error(ex);
312312
reject(ex);
@@ -396,7 +396,7 @@ export function prompt(arg: any): Promise<PromptResult> {
396396
(r) => ({ result: r, text: textField.text })
397397
);
398398

399-
showDialog(dlg, options, resolve);
399+
showDialog(dlg, options);
400400
if (!!options.autoFocus) {
401401
textField.requestFocus();
402402
}
@@ -477,7 +477,7 @@ export function login(arg: any): Promise<LoginResult> {
477477
},
478478
(r) => ({ result: r, userName: userNameTextField.text, password: passwordTextField.text })
479479
);
480-
showDialog(dlg, options, resolve);
480+
showDialog(dlg, options);
481481
if (!!options.autoFocus) {
482482
userNameTextField.requestFocus();
483483
}
@@ -551,7 +551,7 @@ export function action(arg: any): Promise<string> {
551551
}
552552
resolve(r);
553553
});
554-
showDialog(dlg, options, resolve);
554+
showDialog(dlg, options);
555555
} catch (ex) {
556556
console.error(ex);
557557
reject(ex);

0 commit comments

Comments
 (0)