Skip to content

Commit

Permalink
fix: show filtered button only if no next page
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Sep 15, 2024
1 parent af32818 commit 6fb46e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/renderer/src/modules/entry-column/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ function EntryColumnImpl() {
<EntryEmptyList />
)
) : view && views[view].gridMode ? (
<ListGird virtuosoOptions={virtuosoOptions} virtuosoRef={virtuosoRef} />
<ListGird
virtuosoOptions={virtuosoOptions}
virtuosoRef={virtuosoRef}
hasNextPage={entries.hasNextPage}
/>
) : (
<EntryList
{...virtuosoOptions}
Expand All @@ -228,12 +232,14 @@ function EntryColumnImpl() {
const ListGird = ({
virtuosoOptions,
virtuosoRef,
hasNextPage,
}: {
virtuosoOptions: Omit<VirtuosoGridProps<string, unknown>, "data" | "endReached"> & {
data: string[]
endReached: () => Promise<any>
}
virtuosoRef: React.RefObject<VirtuosoHandle>
hasNextPage: boolean
}) => {
const masonry = useUISettingKey("pictureViewMasonry")
const view = useRouteParamsSelector((s) => s.view)
Expand Down Expand Up @@ -270,7 +276,7 @@ const ListGird = ({

const hasFilteredContent = nextData.length < virtuosoOptions.data.length

const FilteredContentTip = hasFilteredContent && (
const FilteredContentTip = hasFilteredContent && !hasNextPage && (
<div className="center mb-6 flex flex-col gap-5">
<i className="i-mgc-photo-album-cute-fi size-12" />
<div>{t("entry_column.filtered_content_tip_2")}</div>
Expand Down

0 comments on commit 6fb46e7

Please sign in to comment.