You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//checks the state before it's updated so need to check the opposite condition
@@ -124,15 +125,8 @@ function Canvas(props: {}): JSX.Element {
124
125
125
126
console.log('Toggle Switch:',toggleSwitch);
126
127
127
-
//Function to handle the click events.
128
-
constmultipleClicks=()=>{
129
-
handleToggleSwitch();
130
-
toggleButton();
131
-
};
132
-
133
128
constsocket=getSocket();
134
-
/* wrap the socket event listener in useEffect with dependency array as [socket], so the effect will run only when:
135
-
1. After the initial rendering of the component 2. Every time the socket instance changes(connect, disconnect) */
129
+
//wrap the socket event listener in useEffect with dependency array as [socket], so the the effect will run only when: 1. After the initial rendering of the component 2. Every time the socket instance changes(connect, disconnect)
136
130
useEffect(()=>{
137
131
console.log(
138
132
'socket inside useEffect:',
@@ -152,6 +146,11 @@ function Canvas(props: {}): JSX.Element {
152
146
};
153
147
},[socket]);
154
148
149
+
useEffect(()=>{
150
+
handleCursorDeleteFromServer();
151
+
console.log('handle delete has been called');
152
+
},[userList]);
153
+
155
154
//-----------------
156
155
157
156
// find the current component based on the canvasFocus component ID in the state
@@ -170,7 +169,7 @@ function Canvas(props: {}): JSX.Element {
170
169
childId?: number|null
171
170
)=>{
172
171
dispatch(changeFocus({ componentId, childId }));
173
-
//if room exists, send focus dispatch to all users
172
+
//if room exists, send focus dispatcht to all users
174
173
if(roomCode){
175
174
emitEvent('changeFocusAction',roomCode,{
176
175
componentId: componentId,
@@ -350,29 +349,19 @@ function Canvas(props: {}): JSX.Element {
0 commit comments