Skip to content

Commit 11f56a6

Browse files
authored
Merge branch 'dev' into temp-C
2 parents 334a355 + 043872c commit 11f56a6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

β€Žclient/src/components/Mom/index.tsxβ€Ž

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ function Mom() {
7878
setBlocks(spreadCRDT());
7979
});
8080

81-
return () => {
82-
socket.off(SOCKET_MESSAGE.MOM.INIT);
83-
};
84-
}, [selectedMom]);
85-
86-
useEffect(() => {
8781
socket.on(SOCKET_MESSAGE.MOM.UPDATE_TITLE, (title) => {
8882
if (!titleRef.current) return;
8983

@@ -116,6 +110,7 @@ function Mom() {
116110

117111
return () => {
118112
[
113+
SOCKET_MESSAGE.MOM.INIT,
119114
SOCKET_MESSAGE.MOM.UPDATE_TITLE,
120115
SOCKET_MESSAGE.MOM.UPDATED,
121116
SOCKET_MESSAGE.MOM.INSERT_BLOCK,
@@ -125,7 +120,7 @@ function Mom() {
125120
SOCKET_MESSAGE.BLOCK.DELETE_TEXT,
126121
].forEach((event) => socket.off(event));
127122
};
128-
}, []);
123+
}, [selectedMom]);
129124

130125
return selectedMom ? (
131126
<div className={style['mom-container']}>

0 commit comments

Comments
Β (0)