From b2d43040b1f7111cb180f6798eea266c1c85166f Mon Sep 17 00:00:00 2001
From: Hazelnoot <acomputerdog@gmail.com>
Date: Sat, 15 Feb 2025 11:49:33 -0500
Subject: factor out shared "compute-merged-cw" routine

---
 packages/frontend-embed/src/components/EmNoteSub.vue | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

(limited to 'packages/frontend-embed/src/components/EmNoteSub.vue')

diff --git a/packages/frontend-embed/src/components/EmNoteSub.vue b/packages/frontend-embed/src/components/EmNoteSub.vue
index e1302bbe25..629f0bffcd 100644
--- a/packages/frontend-embed/src/components/EmNoteSub.vue
+++ b/packages/frontend-embed/src/components/EmNoteSub.vue
@@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 <script lang="ts" setup>
 import { computed, ref } from 'vue';
 import * as Misskey from 'misskey-js';
-import { appendContentWarning } from '@@/js/append-content-warning.js';
+import { computeMergedCw } from '@@/js/compute-merged-cw.js';
 import EmA from '@/components/EmA.vue';
 import EmAvatar from '@/components/EmAvatar.vue';
 import EmNoteHeader from '@/components/EmNoteHeader.vue';
@@ -56,13 +56,7 @@ const props = withDefaults(defineProps<{
 const showContent = ref(false);
 const replies = ref<Misskey.entities.Note[]>([]);
 
-const mergedCW = computed(() => {
-	let cw = props.note.cw;
-	if (props.note.user.mandatoryCW) {
-		cw = appendContentWarning(cw, props.note.user.mandatoryCW);
-	}
-	return cw;
-});
+const mergedCW = computed(() => computeMergedCw(props.note));
 
 if (props.detail) {
 	misskeyApi('notes/children', {
-- 
cgit v1.2.3-freya

