MOBILE-3626 core: Improve get current site home id
parent
9fec3807c2
commit
1958ce4b2b
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue