Skip to content

Commit dd0d211

Browse files
authored
Fix root network panel : update on notification reception (#3022)
Signed-off-by: Ayoub LABIDI <[email protected]>
1 parent bee4316 commit dd0d211

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/graph/menus/root-network/use-root-network-notifications.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useDispatch, useSelector } from 'react-redux';
1010
import { AppState } from 'redux/reducer';
1111
import { NotificationsUrlKeys, useNotificationsListener, useSnackMessage } from '@gridsuite/commons-ui';
1212
import { fetchRootNetworks } from 'services/root-network';
13-
import { setCurrentRootNetworkUuid, setRootNetworks } from 'redux/actions';
13+
import { setCurrentRootNetworkUuid, setMonoRootStudy, setRootNetworks } from 'redux/actions';
1414
import { RootNetworkMetadata } from '../network-modifications/network-modification-menu.type';
1515
import {
1616
isRootNetworkDeletionStartedNotification,
@@ -40,6 +40,9 @@ export const useRootNetworkNotifications = ({ setIsRootNetworksProcessing }: Use
4040
if (res.every((network) => !network.isCreating)) {
4141
setIsRootNetworksProcessing(false);
4242
}
43+
if (res.length > 1) {
44+
dispatch(setMonoRootStudy(false));
45+
}
4346
})
4447
.catch((error) => {
4548
snackError({ messageTxt: error.message });

0 commit comments

Comments
 (0)