fix: disable ai filter for non latest feed

This commit is contained in:
DIYgod 2023-09-15 00:19:15 +08:00
parent 1e08ca5c04
commit b5416560d6
No known key found for this signature in database
2 changed files with 4 additions and 3 deletions

View File

@ -14,10 +14,10 @@ const getOriginalScore = async (cid: string) => {
await fetch(toGateway(`ipfs://${cid}`))
).json()
if (tags?.[0] === "portfolio") {
if (tags?.[0] === "portfolio" || tags?.[0] === "short") {
return {
number: 100,
reason: "Portfolio",
reason: "Whitelist content",
}
}

View File

@ -136,6 +136,7 @@ export const HomeFeed = ({ type }: { type?: FeedType }) => {
.filter((post) => {
if (
aiFiltering &&
hasFiltering &&
post.metadata?.content?.score?.number !== undefined &&
post.metadata.content.score.number <= 60
) {
@ -146,7 +147,7 @@ export const HomeFeed = ({ type }: { type?: FeedType }) => {
}),
)
}
}, [feed.data?.pages, aiFiltering])
}, [feed.data?.pages, aiFiltering, hasFiltering])
const [isMounted, setIsMounted] = useState(false)
useEffect(() => {