diff --git a/packages/web/src/perspectives/PerspectiveTable.svelte b/packages/web/src/perspectives/PerspectiveTable.svelte index 4ce25d536..0012e08a3 100644 --- a/packages/web/src/perspectives/PerspectiveTable.svelte +++ b/packages/web/src/perspectives/PerspectiveTable.svelte @@ -44,6 +44,7 @@ let errorMessage; let isLoading = false; const lastVisibleRowIndexRef = createRef(0); + const disableLoadNextRef = createRef(false); async function loadLevelData(node: PerspectiveTreeNode, parentRows: any[], counts) { dbg('load level data', counts); @@ -146,6 +147,7 @@ $: { display; + disableLoadNextRef.set(false); checkLoadAdditionalData(); } @@ -219,10 +221,11 @@ if (!display) return; await tick(); if (!domTable) return; + if (disableLoadNextRef.get()) return; const rowIndex = getLastVisibleRowIndex(); - console.log('LAST VISIBLE', rowIndex); + // console.log('LAST VISIBLE', rowIndex); const growIndicators = _.keys(display.loadIndicatorsCounts).filter( indicator => rowIndex + 1 >= display.loadIndicatorsCounts[indicator] @@ -233,6 +236,7 @@ // console.log('rowIndex', rowIndex); if (growIndicators.length > 0) { + disableLoadNextRef.set(true); dbg('load next', growIndicators); loadedCounts.update(counts => { const res = { ...counts };