From d9e7a09d248cde3aa48a4c770eb40eb277b42002 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Fri, 5 May 2023 18:12:07 +0200 Subject: [PATCH] feat: respect Media Display preferences (#2065) --- components/status/StatusContent.vue | 12 +++++++++--- components/status/StatusSpoiler.vue | 27 ++++++++++++++++++++------- composables/users.ts | 18 ++++++++++++++++++ locales/en.json | 1 + locales/tl-PH.json | 1 + 5 files changed, 49 insertions(+), 10 deletions(-) diff --git a/components/status/StatusContent.vue b/components/status/StatusContent.vue index d6efd353..27bed9ab 100644 --- a/components/status/StatusContent.vue +++ b/components/status/StatusContent.vue @@ -22,6 +22,12 @@ const isFiltered = $computed(() => status.account.id !== currentUser.value?.acco // check spoiler text or media attachment // needed to handle accounts that mark all their posts as sensitive const hasSpoilerOrSensitiveMedia = $computed(() => !!status.spoilerText || (status.sensitive && !!status.mediaAttachments.length)) +const isSensitiveNonSpoiler = computed(() => status.sensitive && !status.spoilerText) +const hideAllMedia = computed( + () => { + return currentUser.value ? (getHideMediaByDefault(currentUser.value.account) && !!status.mediaAttachments.length) : false + }, +)