diff --git a/themes/default/components/CustomImage.tsx b/themes/default/components/CustomImage.tsx index f01a978e..f4eeedef 100644 --- a/themes/default/components/CustomImage.tsx +++ b/themes/default/components/CustomImage.tsx @@ -18,11 +18,9 @@ const CustomImage = ({ image, width, height, fill, style }: Props) => { // 当前图片是否为nsfw const nsfw = useMemo(() => { - return image.tags.filter((t) => ["Hentai", "Porn", "Sexy"].includes(t.id)).map((item) => item.id); + return (image.tags || []).filter((t) => ["Hentai", "Porn", "Sexy"].includes(t.id)).map((item) => item.id); }, [image]); - console.log(_.difference(nsfw, n)); - const _style = { ...style, filter: _.difference(nsfw, n).length > 0 ? "blur(16px)" : "inherit", diff --git a/themes/default/global.d.ts b/themes/default/global.d.ts index fff46a77..13151a69 100644 --- a/themes/default/global.d.ts +++ b/themes/default/global.d.ts @@ -19,7 +19,7 @@ declare namespace EagleUse { // 图片 export interface Image extends PrismaImage { - tags: Tag[]; + tags?: Tag[]; folders: Folder[]; }