chore: error
This commit is contained in:
parent
ef7f27326d
commit
40844d1633
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user