Skip to content

fix: compile error #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ui/src/lib/store/canvasSlice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,11 @@ export const createCanvasSlice: StateCreator<MyState, [], [], CanvasSlice> = (
selectedPods: new Set(),
selectionParent: undefined,
selectPod: (id, selected) => {
const nodesMap = get().getNodesMap();
set(
produce((state: MyState) => {
if (selected) {
const p = get().getPod(id)?.parent;
const p = nodesMap.get(id)?.parentNode;
// if you select a node that has a different parent, clear all previous selections
if (
state.selectionParent !== undefined &&
Expand Down Expand Up @@ -809,7 +810,7 @@ export const createCanvasSlice: StateCreator<MyState, [], [], CanvasSlice> = (
}
toLevel = scope.data.level + 1;
// FIXME: since richNode and codeNode doesn't have height when it's created, we have to pass its height manually in case crash.
const nodeHeight = get().getPod(nodeId)?.height || 0;
const nodeHeight = nodesMap.get(nodeId)?.height || 0;
position = getNodePositionInsideScope(
node,
scope,
Expand Down