mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 01:06:01 +00:00
perspective load fix
This commit is contained in:
@@ -70,20 +70,25 @@ export class PerspectiveDataProvider {
|
|||||||
// console.log('CACHE', tableCache.bindingGroups);
|
// console.log('CACHE', tableCache.bindingGroups);
|
||||||
|
|
||||||
let groupIndex = 0;
|
let groupIndex = 0;
|
||||||
|
let loadCalled = false;
|
||||||
|
let shouldReturn = false;
|
||||||
for (; groupIndex < props.bindingValues.length; groupIndex++) {
|
for (; groupIndex < props.bindingValues.length; groupIndex++) {
|
||||||
const groupValues = props.bindingValues[groupIndex];
|
const groupValues = props.bindingValues[groupIndex];
|
||||||
const group = tableCache.getBindingGroup(groupValues);
|
const group = tableCache.getBindingGroup(groupValues);
|
||||||
let loadCalled = false;
|
|
||||||
|
|
||||||
if (!group.loadedAll) {
|
if (!group.loadedAll) {
|
||||||
// wee need to load next data
|
if (loadCalled) {
|
||||||
|
shouldReturn = true;
|
||||||
|
} else {
|
||||||
|
// we need to load next data
|
||||||
await this.loadNextGroup(props, groupIndex);
|
await this.loadNextGroup(props, groupIndex);
|
||||||
loadCalled = true;
|
loadCalled = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// console.log('GRP', groupValues, group);
|
// console.log('GRP', groupValues, group);
|
||||||
rows.push(...group.loadedRows);
|
rows.push(...group.loadedRows);
|
||||||
if (rows.length >= props.topCount || loadCalled) {
|
if (rows.length >= props.topCount || shouldReturn) {
|
||||||
return {
|
return {
|
||||||
rows: rows.slice(0, props.topCount),
|
rows: rows.slice(0, props.topCount),
|
||||||
incomplete: props.topCount < rows.length || !group.loadedAll || groupIndex < props.bindingValues.length - 1,
|
incomplete: props.topCount < rows.length || !group.loadedAll || groupIndex < props.bindingValues.length - 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user