refactor: simplify fallback loop to start at segments.length

This commit is contained in:
Deep Mehta
2026-03-18 10:05:09 -07:00
parent a624caed6c
commit 0049de780d

View File

@@ -90,7 +90,7 @@ export const useModelToNodeStore = defineStore('modelToNode', () => {
// Try progressively shorter parent paths
const segments = modelType.split('/')
for (let i = segments.length - 1; i >= 1; i--) {
for (let i = segments.length; i >= 1; i--) {
const parentPath = segments.slice(0, i).join('/')
const fallback = modelToNodeMap.value[parentPath]
if (fallback && fallback.length > 0) return fallback