MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / mergeModelIntoGridCurrentModels

Function mergeModelIntoGridCurrentModels

renderer.js:1407–1418  ·  view source on GitHub ↗

Merge fresh model into virtual grid's currentModels when paths match (normalized).

(model)

Source from the content-addressed store, hash-verified

1405 out.push(model);
1406 continue;
1407 }
1408 const keeper = seen.get(key);
1409 const keepHasId = keeper && keeper.id != null && keeper.id !== '';
1410 const candHasId = model.id != null && model.id !== '';
1411 if (!keepHasId && candHasId) {
1412 const idx = out.indexOf(keeper);
1413 if (idx !== -1) out[idx] = model;
1414 seen.set(key, model);
1415 }
1416 }
1417 return out;
1418}
1419
1420/** Drop expand state for parent groups that no longer have 2+ distinct files. */
1421function pruneParentModelExpandedGroups(models) {

Callers 1

updateModelElementFunction · 0.85

Calls 1

Tested by

no test coverage detected