mirror of https://github.com/elk-zone/elk.git
fix(paginator): item count less than buffer
This commit is contained in:
parent
01a24a6015
commit
333cab0858
|
@ -66,7 +66,10 @@ export function usePaginator<T, P, U = T>(
|
|||
|
||||
if (result.value?.length) {
|
||||
const preprocessedItems = preprocess([...nextItems.value, ...result.value]) as any
|
||||
const itemsToShowCount = preprocessedItems.length - buffer
|
||||
const itemsToShowCount
|
||||
= preprocessedItems.length < buffer
|
||||
? preprocessedItems.length
|
||||
: preprocessedItems.length - buffer
|
||||
nextItems.value = preprocessedItems.slice(itemsToShowCount)
|
||||
items.value.push(...preprocessedItems.slice(0, itemsToShowCount))
|
||||
state.value = 'idle'
|
||||
|
|
Loading…
Reference in New Issue