web: set favicon based on current tenants branding logo
closes #956 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
4f04ab7a5f
commit
b339452843
|
@ -25,7 +25,13 @@ export function config(): Promise<Config> {
|
|||
let globalTenantPromise: Promise<CurrentTenant>;
|
||||
export function tenant(): Promise<CurrentTenant> {
|
||||
if (!globalTenantPromise) {
|
||||
globalTenantPromise = new CoreApi(DEFAULT_CONFIG).coreTenantsCurrentRetrieve();
|
||||
globalTenantPromise = new CoreApi(DEFAULT_CONFIG).coreTenantsCurrentRetrieve().then(tenant => {
|
||||
const relIcon = document.head.querySelector<HTMLLinkElement>("link[rel=icon]");
|
||||
if (relIcon) {
|
||||
relIcon.href = tenant.brandingLogo;
|
||||
}
|
||||
return tenant;
|
||||
});
|
||||
}
|
||||
return globalTenantPromise;
|
||||
}
|
||||
|
|
Reference in a new issue