Skip to content

Commit

Permalink
Merge pull request #2517 from IDEMSInternational/fix/seo-service-config
Browse files Browse the repository at this point in the history
fix: seo service config
  • Loading branch information
chrismclarke authored Nov 11, 2024
2 parents 3ce4cd1 + f604ed0 commit e08b52c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/shared/services/seo/seo.service.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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({});
Expand Down Expand Up @@ -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: ``,
Expand Down

0 comments on commit e08b52c

Please sign in to comment.