From 4fdd025e44406f76ee5a453f4040158f9fdb0702 Mon Sep 17 00:00:00 2001 From: ilya-bkv Date: Mon, 18 Mar 2024 10:22:12 +0300 Subject: [PATCH] [FIX] Show more shouts --- src/components/Views/Home.tsx | 1 - src/stores/zine/articles.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/Views/Home.tsx b/src/components/Views/Home.tsx index 4e4dbce3..5161f75e 100644 --- a/src/components/Views/Home.tsx +++ b/src/components/Views/Home.tsx @@ -64,7 +64,6 @@ export const HomeView = (props: Props) => { limit: CLIENT_LOAD_ARTICLES_COUNT, offset: sortedArticles().length, }) - setIsLoadMoreButtonVisible(hasMore) } diff --git a/src/stores/zine/articles.ts b/src/stores/zine/articles.ts index e517378b..a52abf65 100644 --- a/src/stores/zine/articles.ts +++ b/src/stores/zine/articles.ts @@ -131,9 +131,8 @@ export const loadShout = async (slug: string): Promise => { export const loadShouts = async ( options: LoadShoutsOptions, ): Promise<{ hasMore: boolean; newShouts: Shout[] }> => { - options.limit += 1 const newShouts = await apiClient.getShouts(options) - const hasMore = newShouts?.length === options.limit + 1 + const hasMore = newShouts?.length !== options.limit + 1 && newShouts?.length !== 0 if (hasMore) { newShouts.splice(-1)