fix: default icon for new services

This commit is contained in:
Andras Bacsai 2022-11-14 13:54:06 +01:00
parent 0cc67ed2e5
commit f39a607c1a
2 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,8 @@
<script lang="ts">
export let type: string;
export let isAbsolute = false;
let fallback = '/icons/default.png';
const handleError = (ev: { target: { src: string } }) => (ev.target.src = fallback);
let extension = 'png';
let svgs = [
'languagetool',
@ -46,5 +48,10 @@
</script>
{#if name}
<img class={generateClass()} src={`/icons/${name}.${extension}`} alt={`Icon of ${name}`} />
<img
class={generateClass()}
src={`/icons/${name}.${extension}`}
on:error={handleError}
alt={`Icon of ${name}`}
/>
{/if}

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB