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

Commit

Permalink
fix(preview card): blurhash on sensitive content [
Browse files Browse the repository at this point in the history
  • Loading branch information
collectedmind committed Jan 4, 2024
1 parent b331b95 commit a805854
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 a805854

Please sign in to comment.