Skip to content

Commit ee2268f

Browse files
committed
fix(alert): unhandled promise exception
1 parent 8c4fd56 commit ee2268f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/alert/alert-component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ export class AlertCmp {
259259
}
260260

261261
if (shouldDismiss) {
262-
this.dismiss(button.role);
262+
this.dismiss(button.role).catch(() => {
263+
console.debug('alert can not be dismissed');
264+
});
263265
}
264266
}
265267

src/components/tabs/test/advanced/app.module.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export class TabsPage {
8181
alert.dismiss().then(() => {
8282
resolve();
8383
});
84+
return false;
8485
}
8586
}
8687
]

0 commit comments

Comments
 (0)