From 64d8e1eddaa267e5638adfd851ac461a2f712c47 Mon Sep 17 00:00:00 2001 From: Polle Pas Date: Wed, 6 Nov 2024 15:39:10 +0100 Subject: [PATCH] Fix svelte lint error, removed enum from Image.svelte as they are not supported in Svelte components --- .../src/lib/components/Image/Image.svelte | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) 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}