From 06c7035834e2145b2104c3778682edface10435b Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 26 Oct 2020 10:03:32 +0100 Subject: [PATCH] MOBILE-3565 core: Fix errors when compiling in prod mode --- src/app/components/loading/loading.ts | 8 ++++---- src/app/components/show-password/show-password.ts | 4 ++-- src/app/core/login/pages/site/site.page.ts | 4 ++-- src/app/core/mainmenu/pages/more/more.html | 2 +- src/app/core/mainmenu/pages/more/more.page.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app/components/loading/loading.ts b/src/app/components/loading/loading.ts index 31298fa19..a255e52d7 100644 --- a/src/app/components/loading/loading.ts +++ b/src/app/components/loading/loading.ts @@ -50,20 +50,20 @@ export class CoreLoadingComponent implements OnInit, OnChanges, AfterViewInit { @Input() message?: string; // Message to show while loading. @ViewChild('content') content?: ElementRef; - protected uniqueId!: string; + uniqueId: string; protected element: HTMLElement; // Current element. constructor(element: ElementRef) { this.element = element.nativeElement; + + // Calculate the unique ID. + this.uniqueId = 'core-loading-content-' + CoreUtils.instance.getUniqueId('CoreLoadingComponent'); } /** * Component being initialized. */ ngOnInit(): void { - // Calculate the unique ID. - this.uniqueId = 'core-loading-content-' + CoreUtils.instance.getUniqueId('CoreLoadingComponent'); - if (!this.message) { // Default loading message. this.message = Translate.instance.instant('core.loading'); diff --git a/src/app/components/show-password/show-password.ts b/src/app/components/show-password/show-password.ts index 12dafefe4..6cec76522 100644 --- a/src/app/components/show-password/show-password.ts +++ b/src/app/components/show-password/show-password.ts @@ -45,8 +45,8 @@ export class CoreShowPasswordComponent implements OnInit, AfterViewInit { @ContentChild(IonInput) ionInput?: IonInput; shown!: boolean; // Whether the password is shown. - label?: string; // Label for the button to show/hide. - iconName?: string; // Name of the icon of the button to show/hide. + label!: string; // Label for the button to show/hide. + iconName!: string; // Name of the icon of the button to show/hide. selector = ''; // Selector to identify the input. protected input?: HTMLInputElement | null; // Input affected. diff --git a/src/app/core/login/pages/site/site.page.ts b/src/app/core/login/pages/site/site.page.ts index 4ce8d7381..486d9796e 100644 --- a/src/app/core/login/pages/site/site.page.ts +++ b/src/app/core/login/pages/site/site.page.ts @@ -417,8 +417,8 @@ export class CoreLoginSitePage implements OnInit { * @param event Received Event. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any - filterChanged(event: any): void { - const newValue = event.target.value?.trim().toLowerCase(); + filterChanged(event?: any): void { + const newValue = event?.target.value?.trim().toLowerCase(); if (!newValue || !this.fixedSites) { this.filteredSites = this.fixedSites; } else { diff --git a/src/app/core/mainmenu/pages/more/more.html b/src/app/core/mainmenu/pages/more/more.html index 206208638..2426cab14 100644 --- a/src/app/core/mainmenu/pages/more/more.html +++ b/src/app/core/mainmenu/pages/more/more.html @@ -49,7 +49,7 @@

{{ 'core.scanqr' | translate }}

- +

{{ 'core.mainmenu.website' | translate }}

diff --git a/src/app/core/mainmenu/pages/more/more.page.ts b/src/app/core/mainmenu/pages/more/more.page.ts index bd47f45d8..b26b751cc 100644 --- a/src/app/core/mainmenu/pages/more/more.page.ts +++ b/src/app/core/mainmenu/pages/more/more.page.ts @@ -38,7 +38,7 @@ export class CoreMainMenuMorePage implements OnInit, OnDestroy { handlersLoaded = false; siteInfo?: CoreSiteInfo; siteName?: string; - logoutLabel?: string; + logoutLabel = 'core.mainmenu.changesite'; showScanQR: boolean; showWeb?: boolean; showHelp?: boolean;