diff --git a/packages/client/src/components/MkInstanceTicker.vue b/packages/client/src/components/MkInstanceTicker.vue index a5ff656f6d..d8228b2c0f 100644 --- a/packages/client/src/components/MkInstanceTicker.vue +++ b/packages/client/src/components/MkInstanceTicker.vue @@ -1,7 +1,7 @@ @@ -21,11 +21,12 @@ const props = defineProps<{ // if no instance data is given, this is for the local instance const instance = props.instance ?? { - faviconUrl: getProxiedImageUrlNullable(Instance.iconUrl) ?? getProxiedImageUrlNullable(Instance.faviconUrl) ?? '/favicon.ico', name: instanceName, themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content, }; +const faviconUrl = $computed(() => props.instance ? getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : getProxiedImageUrlNullable(Instance.iconUrl, 'preview') ?? getProxiedImageUrlNullable(Instance.faviconUrl, 'preview') ?? '/favicon.ico'); + const themeColor = instance.themeColor ?? '#777777'; const bg = { @@ -33,13 +34,15 @@ const bg = { }; - diff --git a/packages/client/src/scripts/media-proxy.ts b/packages/client/src/scripts/media-proxy.ts index 76e20786f4..506cb78291 100644 --- a/packages/client/src/scripts/media-proxy.ts +++ b/packages/client/src/scripts/media-proxy.ts @@ -1,13 +1,14 @@ import { query } from '@/scripts/url'; import { url } from '@/config'; -export function getProxiedImageUrl(imageUrl: string): string { +export function getProxiedImageUrl(imageUrl: string, type?: 'preview'): string { return `${url}/proxy/image.webp?${query({ url: imageUrl, + ...(type ? { [type]: "1" } : {}), })}`; } -export function getProxiedImageUrlNullable(imageUrl: string | null | undefined): string | null { +export function getProxiedImageUrlNullable(imageUrl: string | null | undefined, type?: 'preview'): string | null { if (imageUrl == null) return null; - return getProxiedImageUrl(imageUrl); + return getProxiedImageUrl(imageUrl, type); }