From f01fc5af5a1e4690efedc32f12c00e391996db3c 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: Sat, 18 Jan 2025 08:28:20 +0900
Subject: [PATCH] =?UTF-8?q?fix(frontend):=20MkInstanceTicker=E3=81=AE?=
 =?UTF-8?q?=E6=83=85=E5=A0=B1=E3=81=8C=E3=83=AA=E3=82=A2=E3=82=AF=E3=83=86?=
 =?UTF-8?q?=E3=82=A3=E3=83=96=E3=81=A7=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?=
 =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=20(#15123)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* fix(frontend): MkInstanceTickerの情報がリアクティブでない問題を修正

* Update Changelog

---------

Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com>
---
 CHANGELOG.md                                  |  1 +
 .../src/components/MkInstanceTicker.vue       | 28 +++++++++----------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ceb6feab3..109883195d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -26,6 +26,7 @@
 - Fix: 公開範囲がホームのノートの埋め込みウィジェットが読み込まれない問題を修正  
   (Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/803)
 - Fix: 絵文字管理画面で一部の絵文字が表示されない問題を修正
+- Fix: プラグイン `register_note_view_interruptor` でノートのサーバー情報の書き換えができない問題を修正
 - Fix: Botプロテクションの設定変更時は実際に検証を通過しないと保存できないように( #15137 )
 - Fix: ノート検索が使用できない場合でもチャンネルのノート検索欄がでていた問題を修正
 - Fix: `Ui:C:select`で値の変更が画面に反映されない問題を修正
diff --git a/packages/frontend/src/components/MkInstanceTicker.vue b/packages/frontend/src/components/MkInstanceTicker.vue
index fae22baa3f..570c50b627 100644
--- a/packages/frontend/src/components/MkInstanceTicker.vue
+++ b/packages/frontend/src/components/MkInstanceTicker.vue
@@ -4,16 +4,16 @@ SPDX-License-Identifier: AGPL-3.0-only
 -->
 
 <template>
-<div :class="$style.root" :style="bg">
+<div :class="$style.root" :style="themeColorStyle">
 	<img v-if="faviconUrl" :class="$style.icon" :src="faviconUrl"/>
-	<div :class="$style.name">{{ instance.name }}</div>
+	<div :class="$style.name">{{ instanceName }}</div>
 </div>
 </template>
 
 <script lang="ts" setup>
-import { computed } from 'vue';
-import { instanceName } from '@@/js/config.js';
-import { instance as Instance } from '@/instance.js';
+import { computed, type CSSProperties } from 'vue';
+import { instanceName as localInstanceName } from '@@/js/config.js';
+import { instance as localInstance } from '@/instance.js';
 import { getProxiedImageUrlNullable } from '@/scripts/media-proxy.js';
 
 const props = defineProps<{
@@ -25,18 +25,16 @@ const props = defineProps<{
 }>();
 
 // if no instance data is given, this is for the local instance
-const instance = props.instance ?? {
-	name: instanceName,
-	themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content,
-};
+const instanceName = computed(() => props.instance?.name ?? localInstanceName);
 
-const faviconUrl = computed(() => props.instance ? getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : getProxiedImageUrlNullable(Instance.iconUrl, 'preview') ?? '/favicon.ico');
+const faviconUrl = computed(() => getProxiedImageUrlNullable(props.instance?.faviconUrl ?? localInstance.iconUrl, 'preview') ?? '/favicon.ico');
 
-const themeColor = instance.themeColor ?? '#777777';
-
-const bg = {
-	background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
-};
+const themeColorStyle = computed<CSSProperties>(() => {
+	const themeColor = props.instance?.themeColor ?? localInstance.themeColor ?? '#777777';
+	return {
+		background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
+	};
+});
 </script>
 
 <style lang="scss" module>