feat: support child tags in NSFW blur feature (#4640)

* fix: add support for child nsfw tags

* fix: correctly detect child tags of custom NSFW tags

* Update web/src/components/MemoView.tsx

---------

Co-authored-by: Johnny <yourselfhosted@gmail.com>
pull/4654/head
João Tiago 3 months ago committed by GitHub
parent 411a91122b
commit a46301fa77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -60,7 +60,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
const parentPage = props.parentPage || location.pathname;
const nsfw =
workspaceMemoRelatedSetting.enableBlurNsfwContent &&
memo.tags?.some((tag) => workspaceMemoRelatedSetting.nsfwTags.includes(tag.toLowerCase()));
memo.tags?.some((tag) => workspaceMemoRelatedSetting.nsfwTags.some((nsfwTag) => tag === nsfwTag || tag.startsWith(`${nsfwTag}/`)));
// Initial related data: creator.
useAsyncEffect(async () => {

Loading…
Cancel
Save