Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Jan 13, 2025
1 parent 614cf93 commit ad579ca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/components/MGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const MGraph = () => {
id: 9000,
type: 'subscribe_event'
}
console.log('Send')
// console.log('Send')
ws.send(JSON.stringify(req.id && req))
}
const interval = setInterval(() => {
Expand All @@ -223,7 +223,7 @@ const MGraph = () => {
}
ws.send(JSON.stringify(request.id && request))
}
console.log('Clean Up')
// console.log('Clean Up')
removeGetWs()
clearInterval(interval)
document.removeEventListener('subs_graph_update', handleWebsockets)
Expand Down
26 changes: 0 additions & 26 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,6 @@ export default function Home() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

// useEffect(() => {
// const handleWebsockets = () => {
// const req = {
// event_type: 'graph_update',
// id: 9000,
// type: 'subscribe_event'
// }
// // console.log("Send");
// ws.send(JSON.stringify(req.id && req))
// }
// document.addEventListener('subs_device_created', handleWebsockets)
// return () => {
// const removeGetWs = async () => {
// const request = {
// id: 9000,
// type: 'unsubscribe_event',
// event_type: 'graph_update'
// }
// ws.send(JSON.stringify(request.id && request))
// }
// // console.log("Clean Up");
// removeGetWs()
// document.removeEventListener('subs_device_created', handleWebsockets)
// }
// }, [])

useEffect(() => {
const handleWebsockets = () => {
const req = {
Expand Down
6 changes: 0 additions & 6 deletions src/utils/Websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ function createSocket() {
type: 'subscribe_event'
}
ws.send(JSON.stringify(requ.id && requ))
// const reque = {
// event_type: 'graph_update',
// id: 9000,
// type: 'subscribe_event'
// }
// ws.send(JSON.stringify(reque.id && reque))
const reqs = {
event_type: 'scene_activated',
id: 9003,
Expand Down

0 comments on commit ad579ca

Please sign in to comment.