1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 07:35:11 +00:00

fix: explicitly cache images to prevent unexpected behavior

This commit is contained in:
Elias Schneider
2025-06-16 15:59:14 +02:00
parent 4ed312251e
commit 2e5d268798
17 changed files with 142 additions and 58 deletions

View File

@@ -1,11 +1,12 @@
<script lang="ts">
import { m } from '$lib/paraglide/messages';
import { cachedApplicationLogo } from '$lib/utils/cached-image-util';
import { mode } from 'mode-watcher';
import type { HTMLAttributes } from 'svelte/elements';
let { ...props }: HTMLAttributes<HTMLImageElement> = $props();
const isDarkMode = $derived(mode.current === 'dark');
const isLightMode = $derived(mode.current === 'light');
</script>
<img {...props} src="/api/application-configuration/logo?light={!isDarkMode}" alt={m.logo()} />
<img {...props} src={cachedApplicationLogo.getUrl(isLightMode)} alt={m.logo()} />