mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
remove remote pointers on client disconnect
This commit is contained in:
parent
2db2f3f5e4
commit
96320478e6
1 changed files with 6 additions and 0 deletions
|
@ -340,6 +340,12 @@ export class App extends React.Component<any, AppState> {
|
|||
this.socket.on("room-user-count", (collaboratorCount: number) => {
|
||||
this.setState({ collaboratorCount });
|
||||
});
|
||||
this.socket.on("client-disconnected", (socketID: number) => {
|
||||
this.setState(state => {
|
||||
const { [socketID]: omit, ...remotePointers } = state.remotePointers;
|
||||
return { remotePointers };
|
||||
});
|
||||
});
|
||||
this.socket.on("new-user", async (socketID: string) => {
|
||||
this.broadcastSocketData({
|
||||
type: "SCENE_UPDATE",
|
||||
|
|
Loading…
Add table
Reference in a new issue