feat: load archived entries automatically

This commit is contained in:
Stephen Zhou 2024-10-26 20:44:29 +08:00
parent b4a3197e6e
commit 5fe9e0c0e2
No known key found for this signature in database
1 changed files with 7 additions and 0 deletions

View File

@ -169,6 +169,13 @@ function EntryColumnImpl() {
const navigate = useNavigateEntry()
const isRefreshing = entries.isFetching && !entries.isFetchingNextPage
// automatically fetch archived entries when there is no entries in timeline
useEffect(() => {
if (!isArchived && virtuosoOptions.totalCount === 0 && !entries.isLoading) {
setIsArchived(true)
}
}, [entries.isLoading, isArchived, virtuosoOptions.totalCount])
return (
<div
className="relative flex h-full flex-1 flex-col @container"