diff --git a/packages/app/src/components/app/play/index.jsx b/packages/app/src/components/app/play/index.jsx index e0331f6..8a8dd72 100644 --- a/packages/app/src/components/app/play/index.jsx +++ b/packages/app/src/components/app/play/index.jsx @@ -3,6 +3,7 @@ import { React, useEffect, } from '@flecks/react'; +import {push} from '@flecks/react/router'; import {useDispatch} from '@flecks/redux'; import {useSocket} from '@flecks/socket'; import {setSelfEntity} from '@humus/app/state'; @@ -21,7 +22,12 @@ function Play() { // Join. useEffect(() => { const join = async () => { - dispatch(setSelfEntity(await socket.send(['Join']))); + try { + dispatch(setSelfEntity(await socket.send(['Join']))); + } + catch (error) { + dispatch(push('/')); + } }; join(); socket.on('reconnect', join);