MOBILE-3626 core: Improve get current site home id

main
Pau Ferrer Ocaña 2020-12-17 14:42:22 +01:00
parent 9fec3807c2
commit 1958ce4b2b
8 changed files with 8 additions and 8 deletions

View File

@ -45,7 +45,7 @@ export class AddonBlockSiteMainMenuComponent extends CoreBlockBaseComponent impl
* Component being initialized.
*/
async ngOnInit(): Promise<void> {
this.siteHomeId = CoreSites.instance.getCurrentSite()?.getSiteHomeId() || 1;
this.siteHomeId = CoreSites.instance.getCurrentSiteHomeId();
super.ngOnInit();
}

View File

@ -16,7 +16,7 @@
<form (ngSubmit)="submitPassword($event)" #enrolPasswordForm>
<ion-item>
<ion-label>
<core-show-password [name]="'password'">
<core-show-password name="password">
<ion-input
class="ion-text-wrap core-ioninput-password"
name="password"

View File

@ -46,7 +46,7 @@ export class CoreCoursesAvailableCoursesPage implements OnInit {
* @return Promise resolved when done.
*/
protected async loadCourses(): Promise<void> {
const frontpageCourseId = CoreSites.instance.getCurrentSite()!.getSiteHomeId();
const frontpageCourseId = CoreSites.instance.getCurrentSiteHomeId();
try {
const courses = await CoreCourses.instance.getCoursesByField();

View File

@ -39,7 +39,7 @@
</ion-item>
<ion-item *ngIf="siteChecked && !isBrowserSSO" class="ion-margin-bottom">
<ion-label>
<core-show-password [name]="'password'">
<core-show-password name="password">
<ion-input name="password" type="password" placeholder="{{ 'core.login.password' | translate }}"
formControlName="password" [clearOnEdit]="false" autocomplete="current-password" enterkeyhint="go"
required="true">

View File

@ -106,7 +106,7 @@
<ion-label position="stacked">
<span core-mark-required="true">{{ 'core.login.password' | translate }}</span>
</ion-label>
<core-show-password [name]="'password'">
<core-show-password name="password">
<ion-input name="password" type="password" placeholder="{{ 'core.login.password' | translate }}"
formControlName="password" [clearOnEdit]="false" autocomplete="new-password" required="true">
</ion-input>

View File

@ -40,7 +40,7 @@
</ion-item>
<ion-item class="ion-margin-bottom">
<ion-label>
<core-show-password [name]="'password'">
<core-show-password name="password">
<ion-input class="core-ioninput-password" name="password" type="password"
placeholder="{{ 'core.login.password' | translate }}" formControlName="password" [clearOnEdit]="false"
autocomplete="current-password" enterkeyhint="go" required="true">

View File

@ -81,7 +81,7 @@ export class CoreSiteHomeIndexPage implements OnInit, OnDestroy {
}, CoreSites.instance.getCurrentSiteId());
this.currentSite = CoreSites.instance.getCurrentSite()!;
this.siteHomeId = this.currentSite?.getSiteHomeId() || 1;
this.siteHomeId = CoreSites.instance.getCurrentSiteHomeId();
const module = navParams['module'];
if (module) {

View File

@ -47,7 +47,7 @@ export class CoreSiteHomeProvider {
*/
async getNewsForum(siteHomeId?: number): Promise<AddonModForumData> {
if (!siteHomeId) {
siteHomeId = CoreSites.instance.getCurrentSite()?.getSiteHomeId() || 1;
siteHomeId = CoreSites.instance.getCurrentSiteHomeId();
}
const forums = await AddonModForum.instance.getCourseForums(siteHomeId);