Comment
This commit is contained in:
parent
916edf47d4
commit
d79af79bf1
|
@ -367,14 +367,8 @@ export default class DataFetch {
|
|||
let { cursors } = get(this.store)
|
||||
const { pageNumber } = get(this.store)
|
||||
|
||||
const currentNextCursor = cursors[pageNumber + 1]
|
||||
if (currentNextCursor != cursor) {
|
||||
// If the current cursor changed, all the next pages need to be updated, so we mark them as stale
|
||||
cursors = cursors.slice(0, pageNumber + 1)
|
||||
cursors[pageNumber + 1] = cursor
|
||||
}
|
||||
|
||||
if (!rows.length && pageNumber > 0) {
|
||||
// If the full page is gone but we have previous pages, navigate to the previous page
|
||||
this.store.update($store => ({
|
||||
...$store,
|
||||
loading: false,
|
||||
|
@ -383,6 +377,13 @@ export default class DataFetch {
|
|||
return await this.prevPage()
|
||||
}
|
||||
|
||||
const currentNextCursor = cursors[pageNumber + 1]
|
||||
if (currentNextCursor != cursor) {
|
||||
// If the current cursor changed, all the next pages need to be updated, so we mark them as stale
|
||||
cursors = cursors.slice(0, pageNumber + 1)
|
||||
cursors[pageNumber + 1] = cursor
|
||||
}
|
||||
|
||||
this.store.update($store => ({
|
||||
...$store,
|
||||
rows,
|
||||
|
|
Loading…
Reference in New Issue