diff --git a/packages/frontend/src/components/MkInstanceTicker.vue b/packages/frontend/src/components/MkInstanceTicker.vue index d5c445c8d8..d006d6c7c1 100644 --- a/packages/frontend/src/components/MkInstanceTicker.vue +++ b/packages/frontend/src/components/MkInstanceTicker.vue @@ -20,7 +20,8 @@ import { getTickerColors, getTickerInfo } from '@/utility/instance-ticker.js'; export type TickerProps = { readonly instance?: { readonly name?: string | null; - readonly iconUrl?: string | null; + // NOTE: リモートサーバーにおいてiconUrlを参照すると意図した画像にならない https://github.com/taiyme/misskey/issues/210 + // readonly iconUrl?: string | null; readonly faviconUrl?: string | null; readonly themeColor?: string | null; } | null; diff --git a/packages/frontend/src/utility/instance-ticker.ts b/packages/frontend/src/utility/instance-ticker.ts index 53d4ea523a..1b4f0b3ef1 100644 --- a/packages/frontend/src/utility/instance-ticker.ts +++ b/packages/frontend/src/utility/instance-ticker.ts @@ -23,27 +23,24 @@ export const getTickerInfo = (props: TickerProps): TickerInfo => { if (props.channel != null) { return { name: props.channel.name, - iconUrl: getProxiedIconUrl(localInstance) ?? '/favicon.ico', + iconUrl: getProxiedImageUrlNullable(localInstance.iconUrl, 'preview') ?? '/favicon.ico', themeColor: props.channel.color, } as const satisfies TickerInfo; } if (props.instance != null) { return { name: props.instance.name ?? '', - iconUrl: getProxiedIconUrl(props.instance) ?? '/client-assets/dummy.png', + // NOTE: リモートサーバーにおいてiconUrlを参照すると意図した画像にならない https://github.com/taiyme/misskey/issues/210 + iconUrl: getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') ?? '/client-assets/dummy.png', themeColor: props.instance.themeColor ?? TICKER_BG_COLOR_DEFAULT, } as const satisfies TickerInfo; } return { name: localInstance.name ?? host, - iconUrl: getProxiedIconUrl(localInstance) ?? '/favicon.ico', + iconUrl: getProxiedImageUrlNullable(localInstance.iconUrl, 'preview') ?? '/favicon.ico', themeColor: localInstance.themeColor ?? document.querySelector('meta[name="theme-color-orig"]')?.content ?? TICKER_BG_COLOR_DEFAULT, } as const satisfies TickerInfo; }; - -const getProxiedIconUrl = (instance: NonNullable): string | null => { - return getProxiedImageUrlNullable(instance.iconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? null; -}; //#endregion ticker info //#region ticker colors