Skip to content

Commit

Permalink
fix: wrap non-sensitive spoilers in spoiler status (#1864)
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidhaan authored Mar 7, 2023
1 parent bc09a28 commit 69c1bd8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/status/StatusContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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 hasSensitiveSpoilerOrMedia = $computed(() => status.sensitive && (!!status.spoilerText || !!status.mediaAttachments.length))
const hasSpoilerOrSensitiveMedia = $computed(() => !!status.spoilerText || (status.sensitive && !!status.mediaAttachments.length))
</script>

<template>
Expand All @@ -32,7 +32,7 @@ const hasSensitiveSpoilerOrMedia = $computed(() => status.sensitive && (!!status
}"
>
<StatusBody v-if="!isFiltered && status.sensitive && !status.spoilerText" :status="status" :newer="newer" :with-action="!isDetails" :class="isDetails ? 'text-xl' : ''" />
<StatusSpoiler :enabled="hasSensitiveSpoilerOrMedia || isFiltered" :filter="isFiltered" :is-d-m="isDM">
<StatusSpoiler :enabled="hasSpoilerOrSensitiveMedia || isFiltered" :filter="isFiltered" :is-d-m="isDM">
<template v-if="status.spoilerText" #spoiler>
<p>{{ status.spoilerText }}</p>
</template>
Expand Down

0 comments on commit 69c1bd8

Please sign in to comment.