Skip to content

Commit 96d5018

Browse files
committed
fix: add validation to avoid infinite loading
1 parent bc4fa5f commit 96d5018

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

dist/bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/utils/LookmlDiagrammer/utils.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,19 +307,17 @@ export function getJoinedViewsForViews(
307307
})
308308

309309
const aIndex = aBaseObj.fieldIndex
310-
311310
const bIndex = bBaseObj.fieldIndex
312311

313312
const aName = diagramDict.tableData[a] ? a : explore.name
314313
const bName = diagramDict.tableData[b] ? b : explore.name
315314

315+
const aLength = diagramDict.tableData[aName]?.length ?? 0
316+
const bLength = diagramDict.tableData[bName]?.length ?? 0
317+
316318
if (aIndex < bIndex) {
317319
return -1
318-
} else if (
319-
aIndex === bIndex &&
320-
diagramDict.tableData[aName].length <
321-
diagramDict.tableData[bName].length
322-
) {
320+
} else if (aIndex === bIndex && aLength < bLength) {
323321
return -1
324322
}
325323
return 1

0 commit comments

Comments
 (0)