Skip to content

Commit d8c0623

Browse files
committed
fix connected mcs display
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
1 parent e318cd5 commit d8c0623

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/dialogs/network-modifications/equipment-deletion/hvdc-lcc-deletion/use-hvdc-lcc-deletion.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ const useHvdcLccDeletion = () => {
3939
dynamicList: LccShuntCompensatorConnectionInfos[],
4040
editList: LccShuntCompensatorConnectionInfos[]
4141
) {
42-
if (!dynamicList && !editList) {
42+
if (!dynamicList?.length && !editList?.length) {
4343
return [];
44-
} else if (!dynamicList) {
44+
} else if (!dynamicList?.length) {
4545
// TODO: we should refactor modification-server to store only selected MCS
4646
return editList.filter((item) => item.connectedToHvdc);
47-
} else if (!editList) {
47+
} else if (!editList?.length) {
4848
return dynamicList;
4949
}
50+
// dynamicList and editList are not empty : let's merge them
5051
const mergedList: LccShuntCompensatorConnectionInfos[] = dynamicList.map((obj) => {
5152
return { ...obj, connectedToHvdc: false };
5253
});

0 commit comments

Comments
 (0)