Unverified Commit a46301fa authored by João Tiago's avatar João Tiago Committed by GitHub

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: 's avatarJohnny <yourselfhosted@gmail.com>
parent 411a9112
...@@ -60,7 +60,7 @@ const MemoView: React.FC<Props> = (props: Props) => { ...@@ -60,7 +60,7 @@ const MemoView: React.FC<Props> = (props: Props) => {
const parentPage = props.parentPage || location.pathname; const parentPage = props.parentPage || location.pathname;
const nsfw = const nsfw =
workspaceMemoRelatedSetting.enableBlurNsfwContent && 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. // Initial related data: creator.
useAsyncEffect(async () => { useAsyncEffect(async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment