mirror of https://github.com/usememos/memos.git
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>
This commit is contained in:
parent
411a91122b
commit
a46301fa77
|
|
@ -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 () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue