diff --git a/browser/svelte/src/lib/components/Image/Image.svelte b/browser/svelte/src/lib/components/Image/Image.svelte index 2cade7c6..00e23674 100644 --- a/browser/svelte/src/lib/components/Image/Image.svelte +++ b/browser/svelte/src/lib/components/Image/Image.svelte @@ -11,11 +11,11 @@ type SizeIndication, } from './imageHelpers.js'; - enum Support { - Full, - Basic, - None, - } + const Support = { + FULL: 0, + BASIC: 1, + NONE: 2, + }; interface Props extends HTMLImgAttributes { subject: string; @@ -38,13 +38,13 @@ let support = $derived.by(() => { if (imageFormatsWithFullSupport.has(resource.props.mimetype ?? '')) { - return Support.Full; + return Support.FULL; } else if ( imageFormatsWithBasicSupport.has(resource.props.mimetype ?? '') ) { - return Support.Basic; + return Support.BASIC; } else { - return Support.None; + return Support.NONE; } }); @@ -55,9 +55,9 @@
{resource.error.message}
{:else if resource.loading}Loading...
-{:else if support === Support.None} +{:else if support === Support.NONE}Image format not supported
-{:else if support === Support.Basic} +{:else if support === Support.BASIC} -{:else if support === Support.Full} +{:else if support === Support.FULL}