Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #96 from MozillaSocial/fix/sensitive-content-behavior
Browse files Browse the repository at this point in the history
fix(preview card): blurhash on sensitive content
  • Loading branch information
collectedmind authored Jan 5, 2024
2 parents b331b95 + a805854 commit 4c1d3dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/status/StatusContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const hideAllMedia = computed(
/>
<StatusPreviewCard
v-if="status.card"
:sensitive="status.sensitive"
:card="status.card"
:small-picture-only="status.mediaAttachments?.length > 0"
/>
Expand Down
5 changes: 4 additions & 1 deletion components/status/StatusPreviewCardNormal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const props = defineProps<{
card: mastodon.v1.PreviewCard
/** For the preview image, only the small image mode is displayed */
smallPictureOnly?: boolean
/** To use blurhash on preview cards containing sensitive content */
sensitive?: boolean
/** When it is root card in the list, not appear as a child card */
root?: boolean
}>()
Expand All @@ -30,7 +32,8 @@ const cardTypeIconMap: Record<mastodon.v1.PreviewCardType, string> = {
}
const userSettings = useUserSettings()
const shouldLoadAttachment = ref(!getPreferences(userSettings.value, 'enableDataSaving'))
const noDataSaving = !getPreferences(userSettings.value, 'enableDataSaving')
const shouldLoadAttachment = ref(noDataSaving && !props.sensitive)
function loadAttachment() {
shouldLoadAttachment.value = true
Expand Down

0 comments on commit 4c1d3dc

Please sign in to comment.