From b33945284395bbdfc9de354ea3815767043a8740 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Wed, 2 Jun 2021 14:38:24 +0200 Subject: [PATCH] web: set favicon based on current tenants branding logo closes #956 Signed-off-by: Jens Langhammer --- web/src/api/Config.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/api/Config.ts b/web/src/api/Config.ts index bbb578aba..43c604ec2 100644 --- a/web/src/api/Config.ts +++ b/web/src/api/Config.ts @@ -25,7 +25,13 @@ export function config(): Promise { let globalTenantPromise: Promise; export function tenant(): Promise { if (!globalTenantPromise) { - globalTenantPromise = new CoreApi(DEFAULT_CONFIG).coreTenantsCurrentRetrieve(); + globalTenantPromise = new CoreApi(DEFAULT_CONFIG).coreTenantsCurrentRetrieve().then(tenant => { + const relIcon = document.head.querySelector("link[rel=icon]"); + if (relIcon) { + relIcon.href = tenant.brandingLogo; + } + return tenant; + }); } return globalTenantPromise; }