From a8058548e641140bed1d68b08bf436168d19ce12 Mon Sep 17 00:00:00 2001 From: Joel Kelly Date: Thu, 4 Jan 2024 14:17:53 -0800 Subject: [PATCH] fix(preview card): blurhash on sensitive content [ --- components/status/StatusContent.vue | 1 + components/status/StatusPreviewCardNormal.vue | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/components/status/StatusContent.vue b/components/status/StatusContent.vue index 3ef2e3c570..51c1b114a3 100644 --- a/components/status/StatusContent.vue +++ b/components/status/StatusContent.vue @@ -57,6 +57,7 @@ const hideAllMedia = computed( /> diff --git a/components/status/StatusPreviewCardNormal.vue b/components/status/StatusPreviewCardNormal.vue index 1fe9a86034..c4d4d40be5 100644 --- a/components/status/StatusPreviewCardNormal.vue +++ b/components/status/StatusPreviewCardNormal.vue @@ -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 }>() @@ -30,7 +32,8 @@ const cardTypeIconMap: Record = { } 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