Skip to content

Commit

Permalink
fix(dialogs): android alert not resolving
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jan 19, 2021
1 parent 3835976 commit e1e2f4b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/dialogs/dialogs.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -262,9 +262,9 @@ export function alert(arg: any): Promise<void> {

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);
Expand Down Expand Up @@ -306,7 +306,7 @@ export function confirm(arg: any): Promise<boolean> {
: 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);
Expand Down Expand Up @@ -396,7 +396,7 @@ export function prompt(arg: any): Promise<PromptResult> {
(r) => ({ result: r, text: textField.text })
);

showDialog(dlg, options, resolve);
showDialog(dlg, options);
if (!!options.autoFocus) {
textField.requestFocus();
}
Expand Down Expand Up @@ -477,7 +477,7 @@ export function login(arg: any): Promise<LoginResult> {
},
(r) => ({ result: r, userName: userNameTextField.text, password: passwordTextField.text })
);
showDialog(dlg, options, resolve);
showDialog(dlg, options);
if (!!options.autoFocus) {
userNameTextField.requestFocus();
}
Expand Down Expand Up @@ -551,7 +551,7 @@ export function action(arg: any): Promise<string> {
}
resolve(r);
});
showDialog(dlg, options, resolve);
showDialog(dlg, options);
} catch (ex) {
console.error(ex);
reject(ex);
Expand Down

0 comments on commit e1e2f4b

Please sign in to comment.