Skip to content

Commit 90ed5c5

Browse files
feat: reset spreadsheet on socket re-open (#3318)
Signed-off-by: Joris Mancini <[email protected]>
1 parent 91b9aba commit 90ed5c5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/spreadsheet-view/hooks/use-update-equipments-on-notification.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,13 @@ export function useUpdateEquipmentsOnNotification(nodeAliases: NodeAlias[] | und
129129
[builtNodesIds, currentRootNetworkUuid, dispatch, studyUuid, updateEquipmentsLocal]
130130
);
131131

132+
const listenerResetEquipments = useCallback(() => {
133+
dispatch(resetEquipments());
134+
}, [dispatch]);
135+
132136
useNotificationsListener(NotificationsUrlKeys.STUDY, {
133137
listenerCallbackMessage: listenerUpdateEquipmentsLocal,
138+
listenerCallbackOnReopen: listenerResetEquipments,
134139
propsId: SPREADSHEET_EQUIPMENTS_LISTENER_ID,
135140
});
136141
}

0 commit comments

Comments
 (0)