Fix race condition which prevented pagination if the initial page load in a table encountered the internal row join limit
This commit is contained in:
parent
763c04048c
commit
337b1189ec
|
@ -15,8 +15,14 @@ export const initialise = context => {
|
||||||
)
|
)
|
||||||
|
|
||||||
// Fetch next page when fewer than 25 remaining rows to scroll
|
// Fetch next page when fewer than 25 remaining rows to scroll
|
||||||
remainingRows.subscribe(remaining => {
|
const needsNewPage = derived(
|
||||||
if (remaining < 25 && get(rowCount)) {
|
[remainingRows, rowCount],
|
||||||
|
([$remainingRows, $rowCount]) => {
|
||||||
|
return $remainingRows < 25 && $rowCount
|
||||||
|
}
|
||||||
|
)
|
||||||
|
needsNewPage.subscribe($needsNewPage => {
|
||||||
|
if ($needsNewPage) {
|
||||||
rows.actions.loadNextPage()
|
rows.actions.loadNextPage()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue