From 336d8fe785d5b26f85088659db022a45b74c5d9f Mon Sep 17 00:00:00 2001
From: syuilo <Syuilotan@yahoo.co.jp>
Date: Thu, 19 Jan 2023 10:29:30 +0900
Subject: feat(client): リアクション一覧詳細ダイアログを表示できるように
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Resolve #9634
---
 packages/frontend/src/components/MkUserCardMini.vue | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

(limited to 'packages/frontend/src/components/MkUserCardMini.vue')

diff --git a/packages/frontend/src/components/MkUserCardMini.vue b/packages/frontend/src/components/MkUserCardMini.vue
index ec199ad277..457504e6ca 100644
--- a/packages/frontend/src/components/MkUserCardMini.vue
+++ b/packages/frontend/src/components/MkUserCardMini.vue
@@ -11,20 +11,28 @@
 
 <script lang="ts" setup>
 import * as misskey from 'misskey-js';
+import { onMounted } from 'vue';
 import MkMiniChart from '@/components/MkMiniChart.vue';
 import * as os from '@/os';
 import { acct } from '@/filters/user';
 
-const props = defineProps<{
+const props = withDefaults(defineProps<{
 	user: misskey.entities.User;
-}>();
+	withChart: boolean;
+}>(), {
+	withChart: true,
+});
 
 let chartValues = $ref<number[] | null>(null);
 
-os.apiGet('charts/user/notes', { userId: props.user.id, limit: 16 + 1, span: 'day' }).then(res => {
-	// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
-	res.inc.splice(0, 1);
-	chartValues = res.inc;
+onMounted(() => {
+	if (props.withChart) {
+		os.apiGet('charts/user/notes', { userId: props.user.id, limit: 16 + 1, span: 'day' }).then(res => {
+			// 今日のぶんの値はまだ途中の値であり、それも含めると大抵の場合前日よりも下降しているようなグラフになってしまうため今日は弾く
+			res.inc.splice(0, 1);
+			chartValues = res.inc;
+		});
+	}
 });
 </script>
 
-- 
cgit v1.3.1-freya

