File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
client/src/components/Mom Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff 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' ] } >
You canβt perform that action at this time.
0 commit comments