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