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

@ -46,19 +46,18 @@ export class BackButton {
*/
@Prop() text?: string;
private async onClick(ev: Event) {
private onClick(ev: Event) {
const nav = this.el.closest('ion-nav');
ev.preventDefault();
if (nav && nav.canGoBack()) {
nav.pop({ skipIfBusy: true });
} else if (this.defaultHref) {
openURL(this.win, this.defaultHref, ev, 'back');
return nav.pop({ skipIfBusy: true });
}
return openURL(this.win, this.defaultHref, ev, 'back');
}
hostData() {
const showBackButton = !!this.defaultHref;
const showBackButton = this.defaultHref !== undefined;
return {
class: {
@ -72,7 +71,7 @@ export class BackButton {
render() {
const backButtonIcon = this.icon || this.config.get('backButtonIcon', 'arrow-back');
const backButtonText = this.text != null ? this.text : this.config.get('backButtonText', 'Back');
const backButtonText = this.text !== undefined ? this.text : this.config.get('backButtonText', 'Back');
return (
<button