diff --git a/src/core/classes/site.ts b/src/core/classes/site.ts index 6c1a98b95..0c5a101bc 100644 --- a/src/core/classes/site.ts +++ b/src/core/classes/site.ts @@ -296,14 +296,18 @@ export class CoreSite { * @returns Site name. */ async getSiteName(): Promise { + if (this.isDemoModeSite()) { + return CoreConstants.CONFIG.appname; + } + if (this.infos?.sitename) { return this.infos?.sitename; } // Fallback. - const isSigleFixedSite = await CoreLoginHelper.isSingleFixedSite(); + const isSingleFixedSite = await CoreLoginHelper.isSingleFixedSite(); - if (isSigleFixedSite) { + if (isSingleFixedSite) { const sites = await CoreLoginHelper.getAvailableSites(); return sites[0].name; @@ -2459,6 +2463,17 @@ export class CoreSite { }); } + /** + * Check if the site is a demo mode site. + * + * @returns Whether the site is a demo mode site. + */ + isDemoModeSite(): boolean { + const demoSiteData = CoreLoginHelper.getDemoModeSiteInfo(); + + return this.containsUrl(demoSiteData?.url); + } + } /** diff --git a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.html b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.html index 84ac8273c..93d5b734e 100644 --- a/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.html +++ b/src/core/features/contentlinks/components/choose-site-modal/choose-site-modal.html @@ -27,7 +27,7 @@

-

{{site.siteUrl}}

+

{{site.siteUrl}}

diff --git a/src/core/features/login/components/sites/sites.html b/src/core/features/login/components/sites/sites.html index 80e7ce643..cef9d4d73 100644 --- a/src/core/features/login/components/sites/sites.html +++ b/src/core/features/login/components/sites/sites.html @@ -28,8 +28,10 @@ -

{{ - accountsList.currentSite.siteUrlWithoutProtocol }} +

+ + {{ accountsList.currentSite.siteUrlWithoutProtocol }} +

@@ -53,7 +55,9 @@

-

{{ sites[0].siteUrlWithoutProtocol }}

+

+ {{ sites[0].siteUrlWithoutProtocol }} +

diff --git a/src/core/features/login/pages/credentials/credentials.html b/src/core/features/login/pages/credentials/credentials.html index be6df4301..3c76002c6 100644 --- a/src/core/features/login/pages/credentials/credentials.html +++ b/src/core/features/login/pages/credentials/credentials.html @@ -32,7 +32,7 @@

-

{{siteUrl}}

+

{{siteUrl}}

-

{{siteUrl}}

+

{{siteUrl}}

diff --git a/src/core/features/login/pages/email-signup/email-signup.ts b/src/core/features/login/pages/email-signup/email-signup.ts index f0d0f3f3f..c3f2da50f 100644 --- a/src/core/features/login/pages/email-signup/email-signup.ts +++ b/src/core/features/login/pages/email-signup/email-signup.ts @@ -34,6 +34,7 @@ import { CoreForms } from '@singletons/form'; import { CoreRecaptchaComponent } from '@components/recaptcha/recaptcha'; import { CorePath } from '@singletons/path'; import { CoreDom } from '@singletons/dom'; +import { CoreConstants } from '@/core/constants'; /** * Page to signup using email. @@ -51,6 +52,7 @@ export class CoreLoginEmailSignupPage implements OnInit { signupForm: FormGroup; siteUrl!: string; + isDemoModeSite = false; siteConfig?: CoreSitePublicConfigResponse; siteName?: string; authInstructions = ''; @@ -127,6 +129,7 @@ export class CoreLoginEmailSignupPage implements OnInit { } this.siteUrl = siteUrl; + this.isDemoModeSite = CoreLoginHelper.isDemoModeSite(this.siteUrl); // Fetch the data. this.fetchData().finally(() => { @@ -235,7 +238,7 @@ export class CoreLoginEmailSignupPage implements OnInit { */ protected treatSiteConfig(): boolean { if (this.siteConfig?.registerauth == 'email' && !CoreLoginHelper.isEmailSignupDisabled(this.siteConfig)) { - this.siteName = this.siteConfig.sitename; + this.siteName = this.isDemoModeSite ? CoreConstants.CONFIG.appname : this.siteConfig.sitename; this.authInstructions = this.siteConfig.authinstructions; this.ageDigitalConsentVerification = this.siteConfig.agedigitalconsentverification; this.supportName = this.siteConfig.supportname; diff --git a/src/core/features/login/pages/reconnect/reconnect.html b/src/core/features/login/pages/reconnect/reconnect.html index c5baa2686..bfc6ed6b1 100644 --- a/src/core/features/login/pages/reconnect/reconnect.html +++ b/src/core/features/login/pages/reconnect/reconnect.html @@ -40,7 +40,7 @@

-

{{siteUrl}}

+

{{siteUrl}}