From 16bec67f27b24336f6b845d0a48224db51fb01b9 Mon Sep 17 00:00:00 2001 From: TalonTheDragon Date: Mon, 22 May 2023 13:08:32 +0200 Subject: [PATCH] Set postIsExpanded to ref() for reactivity --- packages/client/src/components/MkNote.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 8e6eb0d109..fa82c0e212 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -429,10 +429,10 @@ function readPromo() { isDeleted.value = true; } -let postIsExpanded = false; +let postIsExpanded = ref(false); function setPostExpanded(val: boolean) { - postIsExpanded = val; + postIsExpanded.value = val; } const accessibleLabel = computed(() => { @@ -440,8 +440,8 @@ const accessibleLabel = computed(() => { if (props.note.renote) { label += `${i18n.t("renoted")} ${props.note.renote.user.username}; `; if (props.note.renote.cw) { - label += `content warning: ${props.note.renote.cw}; `; - if (postIsExpanded) { + label += `${i18n.t('cw')}: ${props.note.renote.cw}; `; + if (postIsExpanded.value) { label += `${props.note.renote.text}; `; } } else { @@ -450,7 +450,7 @@ const accessibleLabel = computed(() => { } else { if (props.note.cw) { label += `${i18n.t("cw")}: ${props.note.cw}; `; - if (postIsExpanded) { + if (postIsExpanded.value) { label += `${props.note.text}; `; } } else {