Skip to content

Commit

Permalink
fix fetch apps (langgenius#9453)
Browse files Browse the repository at this point in the history
  • Loading branch information
horochx authored and JunXu01 committed Nov 9, 2024
1 parent bd92452 commit 8981181
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/app/(commonLayout)/apps/Apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ const Apps = () => {
localStorage.removeItem(NEED_REFRESH_APP_LIST_KEY)
mutate()
}
}, [])
}, [mutate, t])

useEffect(() => {
if (isCurrentWorkspaceDatasetOperator)
return router.replace('/datasets')
}, [isCurrentWorkspaceDatasetOperator])
}, [router, isCurrentWorkspaceDatasetOperator])

const hasMore = data?.at(-1)?.has_more ?? true
useEffect(() => {
const hasMore = data?.at(-1)?.has_more ?? true
let observer: IntersectionObserver | undefined
if (anchorRef.current) {
observer = new IntersectionObserver((entries) => {
Expand All @@ -105,7 +105,7 @@ const Apps = () => {
observer.observe(anchorRef.current)
}
return () => observer?.disconnect()
}, [isLoading, setSize, anchorRef, mutate, hasMore])
}, [isLoading, setSize, anchorRef, mutate, data])

const { run: handleSearch } = useDebounceFn(() => {
setSearchKeywords(keywords)
Expand Down

0 comments on commit 8981181

Please sign in to comment.