+
+
{{ 'core.courses.mycourses' | translate }}
+
diff --git a/src/core/features/courses/pages/my/my.ts b/src/core/features/courses/pages/my/my.ts
index 45365fd23..4e3b5e6f9 100644
--- a/src/core/features/courses/pages/my/my.ts
+++ b/src/core/features/courses/pages/my/my.ts
@@ -36,6 +36,7 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
@ViewChild(CoreBlockComponent) block!: CoreBlockComponent;
+ siteName = '';
searchEnabled = false;
downloadCoursesEnabled = false;
userId: number;
@@ -50,6 +51,8 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
this.updateSiteObserver = CoreEvents.on(CoreEvents.SITE_UPDATED, () => {
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
+ this.loadSiteName();
+
}, CoreSites.getCurrentSiteId());
this.userId = CoreSites.getCurrentSiteUserId();
@@ -62,8 +65,9 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
this.searchEnabled = !CoreCourses.isSearchCoursesDisabledInSite();
this.downloadCoursesEnabled = !CoreCourses.isDownloadCoursesDisabledInSite();
- this.loadContent();
+ this.loadSiteName();
+ this.loadContent();
}
/**
@@ -97,6 +101,13 @@ export class CoreCoursesMyCoursesPage implements OnInit, OnDestroy {
this.loaded = true;
}
+ /**
+ * Load the site name.
+ */
+ protected loadSiteName(): void {
+ this.siteName = CoreSites.getRequiredCurrentSite().getSiteName() || '';
+ }
+
/**
* Load fallback blocks.
*/
diff --git a/src/core/features/mainmenu/pages/home/home.ts b/src/core/features/mainmenu/pages/home/home.ts
index b5d9499a9..2db2c4811 100644
--- a/src/core/features/mainmenu/pages/home/home.ts
+++ b/src/core/features/mainmenu/pages/home/home.ts
@@ -55,7 +55,7 @@ export class CoreMainMenuHomePage implements OnInit {
}
/**
- * Initialize the component.
+ * @inheritdoc
*/
ngOnInit(): void {
this.route.queryParams.subscribe((params: Partial & { urlToOpen?: string }) => {
@@ -121,7 +121,7 @@ export class CoreMainMenuHomePage implements OnInit {
* Load the site name.
*/
protected loadSiteName(): void {
- this.siteName = CoreSites.getCurrentSite()?.getSiteName() || '';
+ this.siteName = CoreSites.getRequiredCurrentSite().getSiteName() || '';
}
/**