mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge 2cb1fa5e14
into b5d60973b7
This commit is contained in:
commit
d4badb1476
2 changed files with 13 additions and 0 deletions
|
@ -508,6 +508,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
|||
);
|
||||
|
||||
const fallbackInitializationHandler = () => {
|
||||
console.log("fallbackInitializationHandler");
|
||||
this.initializeRoom({
|
||||
roomLinkData: existingRoomLinkData,
|
||||
fetchScene: true,
|
||||
|
@ -577,7 +578,9 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
|||
case WS_SUBTYPES.INVALID_RESPONSE:
|
||||
return;
|
||||
case WS_SUBTYPES.INIT: {
|
||||
console.log("INIT (1)");
|
||||
if (!this.portal.socketInitialized) {
|
||||
console.log("INIT (2)");
|
||||
this.initializeRoom({ fetchScene: false });
|
||||
const remoteElements = decryptedData.payload.elements;
|
||||
const reconciledElements =
|
||||
|
@ -666,6 +669,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
|||
);
|
||||
|
||||
this.portal.socket.on("first-in-room", async () => {
|
||||
console.log("first-in-room");
|
||||
if (this.portal.socket) {
|
||||
this.portal.socket.off("first-in-room");
|
||||
}
|
||||
|
|
|
@ -39,9 +39,17 @@ class Portal {
|
|||
this.roomId = id;
|
||||
this.roomKey = key;
|
||||
|
||||
this.socket.on("connect", () => {
|
||||
console.log("connect");
|
||||
});
|
||||
|
||||
console.log("subbing to init-room");
|
||||
|
||||
// Initialize socket listeners
|
||||
this.socket.on("init-room", () => {
|
||||
console.log("init-room (1)");
|
||||
if (this.socket) {
|
||||
console.log("init-room (2)");
|
||||
this.socket.emit("join-room", this.roomId);
|
||||
trackEvent("share", "room joined");
|
||||
}
|
||||
|
@ -54,6 +62,7 @@ class Portal {
|
|||
);
|
||||
});
|
||||
this.socket.on("room-user-change", (clients: SocketId[]) => {
|
||||
console.log("room-user-change", clients);
|
||||
this.collab.setCollaborators(clients);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue