mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
refactor(all): strict boolean conditions
This commit is contained in:
@ -127,12 +127,12 @@ export class Modal implements OverlayInterface {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
this.dismiss();
|
||||
return this.dismiss();
|
||||
}
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(null, BACKDROP);
|
||||
}
|
||||
|
||||
@Listen('ionModalDidPresent')
|
||||
@ -177,9 +177,12 @@ export class Modal implements OverlayInterface {
|
||||
* Dismiss the modal overlay after it has been presented.
|
||||
*/
|
||||
@Method()
|
||||
async dismiss(data?: any, role?: string): Promise<void> {
|
||||
await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation);
|
||||
await detachComponent(this.delegate, this.usersElement);
|
||||
async dismiss(data?: any, role?: string): Promise<boolean> {
|
||||
const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation);
|
||||
if (dismissed) {
|
||||
await detachComponent(this.delegate, this.usersElement);
|
||||
}
|
||||
return dismissed;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user