Added removal of nickname on connection error
This commit is contained in:
parent
4e94567f52
commit
d2ca6cc177
@ -118,6 +118,9 @@ function Game() {
|
||||
}));
|
||||
}
|
||||
});
|
||||
connection.on("error", () => {
|
||||
setNicknames(prevNicknames => omit(prevNicknames, [connection.peer]));
|
||||
});
|
||||
connection.send({
|
||||
id: "nickname",
|
||||
data: { [peerId]: currentNicknameRef.current }
|
||||
|
Loading…
Reference in New Issue
Block a user