diff --git a/src/routes/Game.js b/src/routes/Game.js index 39b01e1..895e668 100644 --- a/src/routes/Game.js +++ b/src/routes/Game.js @@ -118,6 +118,9 @@ function Game() { })); } }); + connection.on("error", () => { + setNicknames(prevNicknames => omit(prevNicknames, [connection.peer])); + }); connection.send({ id: "nickname", data: { [peerId]: currentNicknameRef.current }