Skip to content

Commit f31108a

Browse files
committed
remaining consoles removed
1 parent 6b05940 commit f31108a

File tree

10 files changed

+38
-43
lines changed

10 files changed

+38
-43
lines changed

app/src/components/ContextAPIManager/CreateTab/components/AddContextForm.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ const AddContextForm = ({
2525
const { allContext } = contextStore;
2626
const [btnDisabled, setBtnDisabled] = useState(false);
2727
const [open, setOpen] = useState(false);
28-
// const { state } = useSelector((store: RootState) => ({
29-
// state: store.appState
30-
// }));
3128

3229
const color = 'white';
3330

app/src/components/bottom/StylesEditor.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const StylesEditor: React.FC<{
2323
(state: RootState) => state.appState.stylesheet
2424
);
2525
const roomCode = useSelector((store: RootState) => store.roomSlice.roomCode);
26-
26+
2727
//sets state for what text is currently in the csseditor
2828
const [css, setCss] = useState(stylesheet);
2929

@@ -35,7 +35,6 @@ const StylesEditor: React.FC<{
3535
dispatch(updateStylesheet(css));
3636
if (roomCode) {
3737
emitEvent('updateCSSAction', roomCode, css);
38-
console.log('emit updateCSSAction event is triggered in StylesEditor.tsx');
3938
}
4039
};
4140

app/src/components/left/DragDropPanel.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@ Hook state:
2222
const DragDropPanel = (props): JSX.Element => {
2323
const dispatch = useDispatch();
2424

25-
const state = useSelector((store: RootState) => store.appState);
26-
const contextParam = useSelector((store: RootState) => store.contextSlice);
27-
const roomCode = useSelector((store: RootState) => store.roomSlice.roomCode);
25+
const state = useSelector((store: RootState) => store.appState); // current state
26+
const contextParam = useSelector((store: RootState) => store.contextSlice); // current contextParam
27+
const roomCode = useSelector((store: RootState) => store.roomSlice.roomCode); // current roomCode
2828

29+
// function for delete element
2930
const handleDelete = (id: number): void => {
3031
dispatch(deleteElement({ id: id, contextParam: contextParam }));
3132
if (roomCode) {
33+
// send delete element to server to broadcast to all users
3234
emitEvent('deleteElementAction', roomCode, {
3335
id,
3436
contextParam

app/src/components/main/Canvas.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function Canvas(props: {}): JSX.Element {
2626
const userList = useSelector((store: RootState) => store.roomSlice.userList);
2727

2828
//-------cursors tracking-------
29-
console.log('canvas is rendered');
3029

3130
//remote cursor data
3231
const [remoteCursors, setRemoteCursors] = useState([]);
@@ -57,7 +56,6 @@ function Canvas(props: {}): JSX.Element {
5756
const cursorIdx = prevState.findIndex(
5857
(cursor) => cursor.remoteUserName === remoteData.userName
5958
);
60-
//[{x,y,remoteUserName, isVisible}, {...}, {...}]
6159
//existing user
6260
if (cursorIdx >= 0) {
6361
//check if cursor position has changed
@@ -93,7 +91,7 @@ function Canvas(props: {}): JSX.Element {
9391
};
9492

9593
// console.log('userList:', userList);
96-
//[{x,y,remoteUserName, isVisible}, {...}, {...}]
94+
//[{x,y,remoteUserName, isVisible}, {...}, {...}];
9795
// console.log('remoteCursors:', remoteCursors);
9896

9997
// Removes the mouse cursor of the user that leaves the collaboration room.
@@ -145,27 +143,27 @@ function Canvas(props: {}): JSX.Element {
145143
const socket = getSocket();
146144
//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)
147145
useEffect(() => {
148-
console.log(
149-
'socket inside useEffect:',
150-
socket ? 'connected' : 'not connected'
151-
);
146+
// console.log(
147+
// 'socket inside useEffect:',
148+
// socket ? 'connected' : 'not connected'
149+
// );
152150

153151
if (socket) {
154-
console.log('------setting up socket.on event listener-------');
152+
// console.log('------setting up socket.on event listener-------');
155153
socket.on('remote cursor data from server', (remoteData) =>
156154
handleCursorDataFromServer(remoteData)
157155
);
158156
}
159157

160158
return () => {
161-
console.log('clean up cursor event listener after canvas unmount');
159+
// console.log('clean up cursor event listener after canvas unmount');
162160
if (socket) socket.off('remote cursor data from server');
163161
};
164162
}, [socket]);
165163

166164
useEffect(() => {
167165
handleCursorDeleteFromServer();
168-
console.log('handle delete has been called');
166+
// console.log('handle delete has been called');
169167
}, [userList]);
170168

171169
//-----------------
@@ -246,9 +244,9 @@ function Canvas(props: {}): JSX.Element {
246244
contextParam: contextParam
247245
});
248246

249-
console.log(
250-
`emit addChildAction event is triggered in canvas from ${socket.id}`
251-
);
247+
// console.log(
248+
// `emit addChildAction event is triggered in canvas from ${socket.id}`
249+
// );
252250
}
253251
} else if (item.newInstance && item.instanceType === 'Component') {
254252
let hasDiffParent = false;
@@ -297,7 +295,7 @@ function Canvas(props: {}): JSX.Element {
297295
contextParam: contextParam
298296
});
299297

300-
console.log('emit addChildAction event is triggered in canvas');
298+
// console.log('emit addChildAction event is triggered in canvas');
301299
}
302300
}
303301
},

app/src/components/main/DeleteButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ function DeleteButton({ id, name }: DeleteButtons) {
2020
contextParam
2121
});
2222

23-
console.log(
24-
'emit deleteChildAction event is triggered in DeleteButton.tsx'
25-
);
23+
// console.log(
24+
// 'emit deleteChildAction event is triggered in DeleteButton.tsx'
25+
// );
2626
}
2727
};
2828

app/src/components/main/DirectChildComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function DirectChildComponent({ childId, type, typeId, name }: ChildElement) {
4242
componentId: componentId,
4343
childId: childId
4444
});
45-
console.log('emit focus event from DirectChildComponent');
45+
// console.log('emit focus event from DirectChildComponent');
4646
}
4747
};
4848

app/src/components/main/DirectChildHTML.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function DirectChildHTML({ childId, name, type, typeId, style }: ChildElement) {
4444
componentId: componentId,
4545
childId: childId
4646
});
47-
console.log('emit focus event from DirectChildHTML');
47+
// console.log('emit focus event from DirectChildHTML');
4848
}
4949
};
5050

app/src/components/main/DirectChildHTMLNestable.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ function DirectChildHTMLNestable({
115115
contextParam: contextParam
116116
});
117117

118-
console.log(
119-
'emit addChildAction event is triggered in DirectChildHTMLNestable'
120-
);
118+
// console.log(
119+
// 'emit addChildAction event is triggered in DirectChildHTMLNestable'
120+
// );
121121
}
122122
}
123123
}
@@ -139,9 +139,9 @@ function DirectChildHTMLNestable({
139139
contextParam: contextParam
140140
});
141141

142-
console.log(
143-
'emit changePosition event is triggered in DirectChildHTMLNestable'
144-
);
142+
// console.log(
143+
// 'emit changePosition event is triggered in DirectChildHTMLNestable'
144+
// );
145145
}
146146
}
147147
}
@@ -161,7 +161,7 @@ function DirectChildHTMLNestable({
161161
componentId: componentId,
162162
childId: childId
163163
});
164-
console.log('emit focus event from DirectChildHTMLNestable');
164+
// console.log('emit focus event from DirectChildHTMLNestable');
165165
}
166166
};
167167

app/src/components/main/SeparatorChild.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ function DirectChildHTMLNestable({
9191
contextParam: contextParam
9292
});
9393

94-
console.log(
95-
'emit addChildAction event is triggered in SeparatorChild'
96-
);
94+
// console.log(
95+
// 'emit addChildAction event is triggered in SeparatorChild'
96+
// );
9797
}
9898
}
9999
}
@@ -115,9 +115,9 @@ function DirectChildHTMLNestable({
115115
contextParam: contextParam
116116
});
117117

118-
console.log(
119-
'emit changePosition event is triggered in SeparatorChild'
120-
);
118+
// console.log(
119+
// 'emit changePosition event is triggered in SeparatorChild'
120+
// );
121121
}
122122
}
123123
}

app/src/helperFunctions/socket.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const initializeSocket = () => {
99
// will force new socket connection if re-joining to prevent double emits
1010
forceNew: true
1111
});
12-
console.log('A user connected');
13-
console.log('socket:', socket);
12+
// console.log('A user connected');
13+
// console.log('socket:', socket);
1414
// }
1515
};
1616

@@ -22,7 +22,6 @@ export const getSocket = () => {
2222
export const disconnectSocket = () => {
2323
if (socket) {
2424
socket.disconnect();
25-
socket = null;
2625
}
2726
};
2827

0 commit comments

Comments
 (0)