Fixes production build with custom services

This commit is contained in:
2023-09-20 15:44:36 +02:00
parent bcb854aad7
commit f10e380bb2
9 changed files with 51 additions and 32 deletions

View File

@@ -7,12 +7,23 @@
function masked() {
return brand.logo != undefined && brand.asmask == true;
}
function logoURL(): string {
console.log(brand.logo);
if (brand.logo == undefined) {
return '';
}
if (brand.logo.startsWith('https://') || brand.logo.startsWith('http://')) {
return brand.logo;
}
return '/' + brand.logo;
}
</script>
<div style="--mask: url(/{brand.logo || ''}); --mask-color: {color}" class:masked={masked()}>
<div style="--mask: url({logoURL()}); --mask-color: {color}" class:masked={masked()}>
{#if brand.logo}
{#if brand.asmask != true}
<img src={'/' + brand.logo} alt="logo" />
<img src={logoURL()} alt="logo" />
{/if}
{:else if brand.icon}
<i class={brand.icon} />