mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-20 07:49:59 +02:00
One more socket listener moved to Portal (#1507)
* room-user-change listener moved to Portal * Eliminate useless checks * Update src/components/App.tsx Co-Authored-By: Lipis <lipiridis@gmail.com> Co-authored-by: Lipis <lipiridis@gmail.com>
This commit is contained in:
@@ -21,16 +21,19 @@ class Portal {
|
||||
this.roomKey = key;
|
||||
|
||||
// Initialize socket listeners (moving from App)
|
||||
this.socket!.on("init-room", () => {
|
||||
this.socket.on("init-room", () => {
|
||||
if (this.socket) {
|
||||
this.socket.emit("join-room", this.roomID);
|
||||
|
||||
this.app.restoreUserName();
|
||||
}
|
||||
});
|
||||
this.socket!.on("new-user", async (_socketID: string) => {
|
||||
this.socket.on("new-user", async (_socketID: string) => {
|
||||
this.app.broadcastScene(SCENE.INIT);
|
||||
});
|
||||
this.socket.on("room-user-change", (clients: string[]) => {
|
||||
this.app.setCollaborators(clients);
|
||||
});
|
||||
}
|
||||
|
||||
close() {
|
||||
|
Reference in New Issue
Block a user