Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
fix: fix article meta list usage
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Dec 15, 2023
1 parent e13677e commit d5ff922
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/karbon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,4 @@
"access": "public"
},
"gitHead": "8df1f4d5837a7e2ddbff6cc79f5fec256c34a394"
}
}
2 changes: 1 addition & 1 deletion packages/karbon/src/runtime/composables/front-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export function useArticleLoader<UseChunk extends false | number>({
for (const id of [...articles.value.map(({ id }) => id), ...exclude]) {
alreadyUsed.add(id)
}
const source = (await getAllArticles()).data.value ?? []
const source = (await getAllArticles()) ?? []
while (source.length) {
const { result: nextChunk, skip } = getFillArticlesWithSkip(
{ conditions, count: chunk || 1, used: alreadyUsed, sourceCursor },
Expand Down
2 changes: 1 addition & 1 deletion packages/karbon/src/runtime/composables/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function useArticlePagination({
}: UseArticlePaginationInput): UseArticlePaginationReturn {
const { conditions } = normalizeCondition(conditionInput)
const allArticles = useStaticAsyncState(`pagination-article-${hash(conditions)}`, async () => {
const _allArticles = (await getAllArticles()).data.value ?? []
const _allArticles = (await getAllArticles()) ?? []
return _allArticles.filter((article) => evaluateCondition(article, conditions))
})

Expand Down

0 comments on commit d5ff922

Please sign in to comment.