@phosart/common 0.4.60 → 0.4.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3,7 +3,7 @@ export const nsfwConsented = $state({ unblurThumbnails: false, consented: new Sv
|
|
|
3
3
|
export const nsfwBlurStyle = 'filter: blur(200px); overflow: hidden;';
|
|
4
4
|
export function nsfwBlur(nsfw, sha256 = '.', imageType = 'thumb') {
|
|
5
5
|
const didConsent = nsfwConsented.consented === 'all' || nsfwConsented.consented.has(sha256);
|
|
6
|
-
const shouldBlur = didConsent
|
|
6
|
+
const shouldBlur = !didConsent || (!nsfwConsented.unblurThumbnails && imageType === 'thumb');
|
|
7
7
|
if (nsfw && shouldBlur) {
|
|
8
8
|
return nsfwBlurStyle;
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ export function nsfwBlur(
|
|
|
16
16
|
imageType: 'full' | 'thumb' = 'thumb'
|
|
17
17
|
): string {
|
|
18
18
|
const didConsent = nsfwConsented.consented === 'all' || nsfwConsented.consented.has(sha256);
|
|
19
|
-
const shouldBlur = didConsent
|
|
19
|
+
const shouldBlur = !didConsent || (!nsfwConsented.unblurThumbnails && imageType === 'thumb');
|
|
20
20
|
if (nsfw && shouldBlur) {
|
|
21
21
|
return nsfwBlurStyle;
|
|
22
22
|
}
|