Skip to content

Commit 1510a60

Browse files
fix(spreadsheet): dont' load equipment if deleted in current node (#3304)
Signed-off-by: Joris Mancini <[email protected]> Co-authored-by: Achour berrahma <[email protected]>
1 parent b97ef56 commit 1510a60

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/spreadsheet-view/spreadsheet/spreadsheet-content/spreadsheet-content.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,13 @@ export const SpreadsheetContent = memo(
141141
const nodeAlias = nodeAliases.find((value) => value.id === nodeId);
142142
if (nodeAlias) {
143143
Object.values(nodeEquipments).forEach((eq) => {
144-
prev[eq.id] = {
145-
...prev[eq.id],
146-
[nodeAlias.alias]: eq,
147-
};
144+
// To avoid empty lines in case of deleted equipments in current node but defined in another one
145+
if (prev[eq.id] !== undefined) {
146+
prev[eq.id] = {
147+
...prev[eq.id],
148+
[nodeAlias.alias]: eq,
149+
};
150+
}
148151
});
149152
}
150153
return prev;

0 commit comments

Comments
 (0)