Skip to content

Commit 1cacfeb

Browse files
committed
Websocket emitter for addroute
1 parent 7bc5cf8 commit 1cacfeb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/src/components/main/AddRoute.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import React from 'react';
33
import { useDispatch, useSelector } from 'react-redux';
44
import { addChild } from '../../redux/reducers/slice/appStateSlice';
55
import { RootState } from '../../redux/store';
6-
import { PanoramaSharp } from '@mui/icons-material';
76
import { emitEvent } from '../../helperFunctions/socket';
87

9-
const roomCode = useSelector((store: RootState) => store.roomSlice.roomCode);
10-
118
function AddRoute({ id }: AddRoutes): JSX.Element {
9+
const roomCode = useSelector((store: RootState) => store.roomSlice.roomCode);
1210
const dispatch = useDispatch();
1311
const contextParam = useSelector((store: RootState) => store.contextSlice);
1412
const handleClick = (id: number): void => {
@@ -27,8 +25,11 @@ function AddRoute({ id }: AddRoutes): JSX.Element {
2725
childId: id,
2826
contextParam: contextParam
2927
});
28+
29+
console.log('emit addChildAction event is triggered in AddRoute!');
3030
}
3131
};
32+
3233
return (
3334
<div style={{ padding: '1px', float: 'right' }}>
3435
<button id={'routeBtn' + id} onClick={() => handleClick(id)}>

0 commit comments

Comments
 (0)