mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
web/app: remove debug log
This commit is contained in:
parent
842c8a593a
commit
e6f0fc593c
1 changed files with 3 additions and 11 deletions
|
@ -27,18 +27,10 @@ function App() {
|
||||||
const client = useMemo(() => new Client(new WSClient("/_gomuks/websocket")), [])
|
const client = useMemo(() => new Client(new WSClient("/_gomuks/websocket")), [])
|
||||||
const connState = useEventAsState(client.rpc.connect)
|
const connState = useEventAsState(client.rpc.connect)
|
||||||
const clientState = useEventAsState(client.state)
|
const clientState = useEventAsState(client.state)
|
||||||
|
;((window as unknown) as { client: Client }).client = client
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
((window as unknown) as { client: Client }).client = client
|
|
||||||
|
|
||||||
// TODO remove this debug log
|
|
||||||
const unlistenDebug = client.rpc.event.listen(ev => {
|
|
||||||
console.debug("Received event:", ev)
|
|
||||||
})
|
|
||||||
client.rpc.start()
|
client.rpc.start()
|
||||||
return () => {
|
return () => client.rpc.stop()
|
||||||
unlistenDebug()
|
|
||||||
client.rpc.stop()
|
|
||||||
}
|
|
||||||
}, [client])
|
}, [client])
|
||||||
|
|
||||||
if (connState?.error) {
|
if (connState?.error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue