summaryrefslogtreecommitdiff
path: root/packages/frontend-embed/src/components/EmNoteSimple.vue
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2025-02-20 10:20:49 +0000
committerdakkar <dakkar@thenautilus.net>2025-02-20 10:20:49 +0000
commit534c35cca2b2492dea05b7c7b23802af5435291a (patch)
treed3dec52a465dc2797919e03a7d2d049960a1c86e /packages/frontend-embed/src/components/EmNoteSimple.vue
parentmerge: Add separate redis for rate limit (!908) (diff)
parentadd `admin/cw-user` to new endpoints list (diff)
downloadsharkey-534c35cca2b2492dea05b7c7b23802af5435291a.tar.gz
sharkey-534c35cca2b2492dea05b7c7b23802af5435291a.tar.bz2
sharkey-534c35cca2b2492dea05b7c7b23802af5435291a.zip
merge: Add "force content warning" setting for user moderation (resolves #905) (!876)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/876 Closes #905 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Marie <github@yuugi.dev>
Diffstat (limited to 'packages/frontend-embed/src/components/EmNoteSimple.vue')
-rw-r--r--packages/frontend-embed/src/components/EmNoteSimple.vue11
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/frontend-embed/src/components/EmNoteSimple.vue b/packages/frontend-embed/src/components/EmNoteSimple.vue
index 83e73f9870..688758edb6 100644
--- a/packages/frontend-embed/src/components/EmNoteSimple.vue
+++ b/packages/frontend-embed/src/components/EmNoteSimple.vue
@@ -9,11 +9,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.main">
<EmNoteHeader :class="$style.header" :note="note" :mini="true"/>
<div>
- <p v-if="note.cw != null" :class="$style.cw">
- <EmMfm v-if="note.cw != ''" style="margin-right: 8px;" :text="note.cw" :author="note.user" :nyaize="'respect'" :emojiUrls="note.emojis" :isBlock="true"/>
+ <p v-if="mergedCW != null" :class="$style.cw">
+ <EmMfm v-if="mergedCW != ''" style="margin-right: 8px;" :text="mergedCW" :author="note.user" :nyaize="'respect'" :emojiUrls="note.emojis" :isBlock="true"/>
<button style="display: block; width: 100%;" class="_buttonGray _buttonRounded" @click="showContent = !showContent">{{ showContent ? i18n.ts._cw.hide : i18n.ts._cw.show }}</button>
</p>
- <div v-show="note.cw == null || showContent">
+ <div v-show="mergedCW == null || showContent">
<EmSubNoteContent :class="$style.text" :note="note"/>
</div>
</div>
@@ -22,8 +22,9 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
-import { ref } from 'vue';
+import { computed, ref } from 'vue';
import * as Misskey from 'misskey-js';
+import { computeMergedCw } from '@@/js/compute-merged-cw.js';
import { i18n } from '@/i18n.js';
import EmAvatar from '@/components/EmAvatar.vue';
import EmNoteHeader from '@/components/EmNoteHeader.vue';
@@ -35,6 +36,8 @@ const props = defineProps<{
}>();
const showContent = ref(false);
+
+const mergedCW = computed(() => computeMergedCw(props.note));
</script>
<style lang="scss" module>