fix: remove prev entries ids ref

This commit is contained in:
Stephen Zhou 2024-11-28 15:53:06 +08:00
parent 5beaca3c77
commit 996629c14c
No known key found for this signature in database
1 changed files with 1 additions and 11 deletions

View File

@ -64,13 +64,6 @@ function EntryColumnImpl() {
const { entriesIds, isFetchingNextPage, groupedCounts } = entries
useSnapEntryIdList(entriesIds)
const prevEntriesIdsRef = useRef(entriesIds)
useEffect(() => {
if (entriesIds.length > 0) {
prevEntriesIdsRef.current = entriesIds
}
}, [entriesIds])
const {
entryId: activeEntryId,
@ -135,9 +128,6 @@ function EntryColumnImpl() {
}
}, [shouldLoadArchivedEntries])
const finalEntriesIds =
hasNoEntries && !isArchived ? prevEntriesIdsRef.current || entriesIds : entriesIds
const scrollRef = useRef<HTMLDivElement>(null)
const handleScroll = useCallback(
@ -195,7 +185,7 @@ function EntryColumnImpl() {
await entries.fetchNextPage()
}
}, [entries]),
data: finalEntriesIds,
data: entriesIds,
onScroll: handleScroll,
itemContent: useTypeScriptHappyCallback(
(_, entryId) => {