diff --git a/apps/renderer/src/modules/entry-column/hooks.ts b/apps/renderer/src/modules/entry-column/hooks.ts index 7ad41f7510..c04c13ee6c 100644 --- a/apps/renderer/src/modules/entry-column/hooks.ts +++ b/apps/renderer/src/modules/entry-column/hooks.ts @@ -228,8 +228,6 @@ export const useEntriesByView = ({ }, [query, view]), entriesIds: sortEntries, groupedCounts, - totalCount: query.data?.pages?.[0]?.total ?? mergedEntries[view].length, - queryTotalCount: query.data?.pages?.[0]?.total, } } diff --git a/apps/renderer/src/modules/entry-column/index.tsx b/apps/renderer/src/modules/entry-column/index.tsx index 7b500c9156..43ccf83134 100644 --- a/apps/renderer/src/modules/entry-column/index.tsx +++ b/apps/renderer/src/modules/entry-column/index.tsx @@ -121,8 +121,8 @@ function EntryColumnImpl() { !isArchived && !unreadOnly && !isCollection && routeFeedId !== ROUTE_FEED_PENDING // Determine if the archived button should be shown - const showArchivedButton = commonConditions && entries.totalCount < 40 && feed?.type === "feed" - const hasNoEntries = entries.queryTotalCount === 0 && !entries.isLoading + const showArchivedButton = commonConditions && feed?.type === "feed" + const hasNoEntries = entries.data?.pages?.[0].data?.length === 0 && !entries.isLoading // Determine if archived entries should be loaded const shouldLoadArchivedEntries = @@ -173,13 +173,7 @@ function EntryColumnImpl() { } else { if (context?.onlyShowArchivedButton) return null return ( - + ) } }, @@ -196,13 +190,9 @@ function EntryColumnImpl() { customScrollParent: scrollRef.current!, initialScrollTop: prevScrollTopMap[routeFeedId || ""] || 0, - totalCount: entries.totalCount, endReached: useCallback(async () => { - if (!entries.isFetchingNextPage) { - const remaining = entries.data?.pages.at(-1)?.remaining - if (entries.hasNextPage && remaining) { - await entries.fetchNextPage() - } + if (!entries.isFetchingNextPage && entries.hasNextPage) { + await entries.fetchNextPage() } }, [entries]), data: finalEntriesIds, @@ -233,9 +223,8 @@ function EntryColumnImpl() { entryId: null, }) } - data-total-count={virtuosoOptions.totalCount} > - {virtuosoOptions.totalCount === 0 && + {virtuosoOptions.data.length === 0 && !entries.isLoading && !entries.error && feed?.type === "feed" && } @@ -243,7 +232,6 @@ function EntryColumnImpl() { @@ -252,7 +240,7 @@ function EntryColumnImpl() { onPullToRefresh={entries.refetch} key={`${routeFeedId}-${view}`} > - {virtuosoOptions.totalCount === 0 && !showArchivedButton ? ( + {virtuosoOptions.data.length === 0 && !showArchivedButton ? ( entries.isLoading ? null : ( ) diff --git a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx index a89b090c9a..8d9aeda6c8 100644 --- a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.desktop.tsx @@ -30,11 +30,10 @@ import { } from "./EntryListHeader.shared" export const EntryListHeader: FC<{ - totalCount: number refetch: () => void isRefreshing: boolean hasUpdate: boolean -}> = ({ totalCount, refetch, isRefreshing, hasUpdate }) => { +}> = ({ refetch, isRefreshing, hasUpdate }) => { const routerParams = useRouteParams() const { t } = useTranslation() @@ -55,10 +54,9 @@ export const EntryListHeader: FC<{
- {totalCount || 0} {t("quantifier.piece", { ns: "common" })} {unreadOnly && !isInCollectionList ? t("words.unread") : ""} {t("space", { ns: "common" })} - {t("words.items", { ns: "common", count: totalCount })} + {t("words.items", { ns: "common", count: 2 })}
) diff --git a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.mobile.tsx b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.mobile.tsx index a79c0f0b2c..eb0a89be10 100644 --- a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.mobile.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.mobile.tsx @@ -34,12 +34,7 @@ import { } from "./EntryListHeader.shared" import { TimelineTabs } from "./TimelineTabs" -export const EntryListHeader: FC = ({ - totalCount, - refetch, - isRefreshing, - hasUpdate, -}) => { +export const EntryListHeader: FC = ({ refetch, isRefreshing, hasUpdate }) => { const routerParams = useRouteParams() const { t } = useTranslation() @@ -62,10 +57,9 @@ export const EntryListHeader: FC = ({
- {totalCount || 0} {t("quantifier.piece", { ns: "common" })} {unreadOnly && !isInCollectionList ? t("words.unread") : ""} {t("space", { ns: "common" })} - {t("words.items", { ns: "common", count: totalCount })} + {t("words.items", { ns: "common", count: 2 })}
) diff --git a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx index 55aca52058..6f30cb92f4 100644 --- a/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx +++ b/apps/renderer/src/modules/entry-column/layouts/EntryListHeader.shared.tsx @@ -149,7 +149,6 @@ export const AppendTaildingDivider = ({ children }: { children: React.ReactNode ) export interface EntryListHeaderProps { - totalCount: number refetch: () => void isRefreshing: boolean hasUpdate: boolean diff --git a/apps/renderer/src/store/entry/store.ts b/apps/renderer/src/store/entry/store.ts index 7cdc577f45..f9b7449cf7 100644 --- a/apps/renderer/src/store/entry/store.ts +++ b/apps/renderer/src/store/entry/store.ts @@ -7,7 +7,7 @@ import type { InboxModel, } from "@follow/models/types" import type { EntryReadHistoriesModel } from "@follow/shared/hono" -import { isBizId, omitObjectUndefinedValue } from "@follow/utils/utils" +import { omitObjectUndefinedValue } from "@follow/utils/utils" import { isNil, merge, omit } from "es-toolkit/compat" import { produce } from "immer" @@ -163,16 +163,6 @@ class EntryActions { if (data.data) { this.upsertMany(data.data, { isArchived }) } - - // Sync unread count if fetch unread feedId entries - if ( - read === false && - typeof feedId === "string" && - isBizId(feedId) && - typeof data.total === "number" - ) { - feedUnreadActions.updateByFeedId(feedId, data.total) - } return data } diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts index c365dbea5a..d42ee59e78 100644 --- a/packages/shared/src/hono.ts +++ b/packages/shared/src/hono.ts @@ -5364,6 +5364,21 @@ declare const _routes: hono_hono_base.HonoBase