From d19042cd4f8b2356b9e19ce4f78805653a2779f8 Mon Sep 17 00:00:00 2001 From: chrismclarke Date: Sat, 9 Nov 2024 11:17:14 -0800 Subject: [PATCH] fix: seo service config --- src/app/shared/services/seo/seo.service.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/shared/services/seo/seo.service.ts b/src/app/shared/services/seo/seo.service.ts index 6e9b254d15..81f00f1cb8 100644 --- a/src/app/shared/services/seo/seo.service.ts +++ b/src/app/shared/services/seo/seo.service.ts @@ -1,6 +1,7 @@ import { Injectable } from "@angular/core"; import { SyncServiceBase } from "../syncService.base"; import { DeploymentService } from "../deployment/deployment.service"; +import { AppConfigService } from "../app-config/app-config.service"; interface ISEOMeta { title: string; @@ -21,7 +22,10 @@ type IMetaName = providedIn: "root", }) export class SeoService extends SyncServiceBase { - constructor(private deploymentService: DeploymentService) { + constructor( + private deploymentService: DeploymentService, + private appConfigService: AppConfigService + ) { super("SEO Service"); // call after init to apply defaults this.updateMeta({}); @@ -65,12 +69,14 @@ export class SeoService extends SyncServiceBase { private getDefaultSEOTags(): ISEOMeta { const PUBLIC_URL = location.origin; let faviconUrl = `${PUBLIC_URL}/assets/icon/favicon.svg`; - const { web, app_config } = this.deploymentService.config; + const { web } = this.deploymentService.config; + const { title } = this.appConfigService.appConfig().APP_HEADER_DEFAULTS; + if (web?.favicon_asset) { faviconUrl = `${PUBLIC_URL}/assets/app_data/assets/${web.favicon_asset}`; } return { - title: app_config.APP_HEADER_DEFAULTS.title, + title, description: "", faviconUrl, imageUrl: ``,