diff --git a/app/soapbox/entity-store/hooks/useEntities.ts b/app/soapbox/entity-store/hooks/useEntities.ts index c1bf47e847..a99ce86317 100644 --- a/app/soapbox/entity-store/hooks/useEntities.ts +++ b/app/soapbox/entity-store/hooks/useEntities.ts @@ -65,11 +65,12 @@ function useEntities( const schema = opts.schema || z.custom(); const entities = filteredArray(schema).parse(response.data); const parsedCount = realNumberSchema.safeParse(response.headers['x-total-count']); + const totalCount = parsedCount.success ? parsedCount.data : undefined; dispatch(entitiesFetchSuccess(entities, entityType, listKey, { next: getNextLink(response), prev: getPrevLink(response), - totalCount: parsedCount.success ? parsedCount.data : undefined, + totalCount: Number(totalCount) >= entities.length ? totalCount : undefined, fetching: false, fetched: true, error: null,