refactor(all): strict boolean conditions

This commit is contained in:
Manu Mtz.-Almeida
2018-08-31 18:59:09 +02:00
parent f383ebdf13
commit ba2230510e
96 changed files with 990 additions and 962 deletions

View File

@ -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;
}
/**