From 0f8b15f0fec1a474b8f5a0c0c4b7be5ccd42b493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:28:32 +0900 Subject: [PATCH] fix(frontend-embed): fix instanceticker, remove directives (#14631) --- packages/frontend-embed/src/components/EmInstanceTicker.vue | 4 ++-- packages/frontend-embed/src/components/EmMention.vue | 2 +- packages/frontend-embed/src/components/EmNote.vue | 4 +++- packages/frontend-embed/src/components/EmNoteDetailed.vue | 2 ++ packages/frontend-embed/src/components/EmNoteHeader.vue | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/frontend-embed/src/components/EmInstanceTicker.vue b/packages/frontend-embed/src/components/EmInstanceTicker.vue index eeeaee528..4a116e317 100644 --- a/packages/frontend-embed/src/components/EmInstanceTicker.vue +++ b/packages/frontend-embed/src/components/EmInstanceTicker.vue @@ -29,12 +29,12 @@ const props = defineProps<{ // if no instance data is given, this is for the local instance const instance = props.instance ?? { name: serverMetadata.name, - themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content, + themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content, }; const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(serverMetadata.iconUrl, 'preview') ?? '/favicon.ico'); -const themeColor = serverMetadata.themeColor ?? '#777777'; +const themeColor = props.instance?.themeColor ?? serverMetadata.themeColor ?? '#777777'; const bg = { background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`, diff --git a/packages/frontend-embed/src/components/EmMention.vue b/packages/frontend-embed/src/components/EmMention.vue index 777033bd3..a63178350 100644 --- a/packages/frontend-embed/src/components/EmMention.vue +++ b/packages/frontend-embed/src/components/EmMention.vue @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only -->