Skip to content

Commit 663db5e

Browse files
authored
Fix: root network switch infinite loading (#3317)
Signed-off-by: LE SAULNIER Kevin <[email protected]>
1 parent 9dc89b3 commit 663db5e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/study-container.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,14 @@ export function StudyContainer({ view, onChangeTab }) {
500500
// connectNotifications don't change
501501
}, [dispatch, studyUuid]);
502502

503+
// WARN: this must be the last effect of the component
504+
// It updates refs (currentNode, currentRootNetworkUuid) which are used
505+
// for comparison in previous effects
506+
useEffect(() => {
507+
currentNodeRef.current = currentNode;
508+
currentRootNetworkUuidRef.current = currentRootNetworkUuid;
509+
}, [currentNode, currentRootNetworkUuid]);
510+
503511
return (
504512
<WaitingLoader
505513
errMessage={studyErrorMessage || errorMessage}

0 commit comments

Comments
 (0)