Skip to content

Commit

Permalink
chore: list
Browse files Browse the repository at this point in the history
  • Loading branch information
Caele committed Dec 7, 2022
1 parent 6339fd9 commit 5655075
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions apis/nucleus/src/components/Sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function Sheet({ model, halo, initialSnOptions, initialSnPlugins, initialError,
// TODO - should try reuse existing objects on subsequent renders
// Non-id updates should only change the "css"
const cs = await Promise.all(
lCells.map(async (c, i) => {
lCells.map(async (c) => {
let mounted;
const mountedPromise = new Promise((resolve) => {
mounted = resolve;
Expand All @@ -80,21 +80,20 @@ function Sheet({ model, halo, initialSnOptions, initialSnPlugins, initialError,
};
})
);
cs.forEach((c) => {
// TODO - these needs to be removed as well
root.addCell(c.currentId, c.cellRef);
});
cs.forEach((c) => root.addCell(c.currentId, c.cellRef));
setCells(cs);
};
fetchObjects();
}
}, [layout]);

const cellRenderers = useMemo(() => {
return cells
? cells.map((c) => getCellRenderer(c, halo, initialSnOptions, initialSnPlugins, initialError, c.mounted))
: [];
}, [cells]);
const cellRenderers = useMemo(
() =>
cells
? cells.map((c) => getCellRenderer(c, halo, initialSnOptions, initialSnPlugins, initialError, c.mounted))
: [],
[cells]
);

useEffect(() => {
const bgComp = layout?.components ? layout.components.find((comp) => comp.key === 'general') : null;
Expand Down
2 changes: 1 addition & 1 deletion apis/nucleus/src/components/sheetGlue.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function glue({ halo, element, model, initialSnOptions, initialSn

root.add(portal);
// Cannot use model.id as it is not unique in a given mashup
//root.addCell(currentId, sheetRef); // this is not needed, sheet is not part of the focus stuff
// root.addCell(currentId, sheetRef); // this is not needed, sheet is not part of the focus stuff

return [unmount, sheetRef];
}

0 comments on commit 5655075

Please sign in to comment.