This commit is contained in:
David Luzar 2025-04-19 00:23:57 +00:00 committed by GitHub
commit d4badb1476
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -508,6 +508,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
); );
const fallbackInitializationHandler = () => { const fallbackInitializationHandler = () => {
console.log("fallbackInitializationHandler");
this.initializeRoom({ this.initializeRoom({
roomLinkData: existingRoomLinkData, roomLinkData: existingRoomLinkData,
fetchScene: true, fetchScene: true,
@ -577,7 +578,9 @@ class Collab extends PureComponent<CollabProps, CollabState> {
case WS_SUBTYPES.INVALID_RESPONSE: case WS_SUBTYPES.INVALID_RESPONSE:
return; return;
case WS_SUBTYPES.INIT: { case WS_SUBTYPES.INIT: {
console.log("INIT (1)");
if (!this.portal.socketInitialized) { if (!this.portal.socketInitialized) {
console.log("INIT (2)");
this.initializeRoom({ fetchScene: false }); this.initializeRoom({ fetchScene: false });
const remoteElements = decryptedData.payload.elements; const remoteElements = decryptedData.payload.elements;
const reconciledElements = const reconciledElements =
@ -666,6 +669,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
); );
this.portal.socket.on("first-in-room", async () => { this.portal.socket.on("first-in-room", async () => {
console.log("first-in-room");
if (this.portal.socket) { if (this.portal.socket) {
this.portal.socket.off("first-in-room"); this.portal.socket.off("first-in-room");
} }

View file

@ -39,9 +39,17 @@ class Portal {
this.roomId = id; this.roomId = id;
this.roomKey = key; this.roomKey = key;
this.socket.on("connect", () => {
console.log("connect");
});
console.log("subbing to init-room");
// Initialize socket listeners // Initialize socket listeners
this.socket.on("init-room", () => { this.socket.on("init-room", () => {
console.log("init-room (1)");
if (this.socket) { if (this.socket) {
console.log("init-room (2)");
this.socket.emit("join-room", this.roomId); this.socket.emit("join-room", this.roomId);
trackEvent("share", "room joined"); trackEvent("share", "room joined");
} }
@ -54,6 +62,7 @@ class Portal {
); );
}); });
this.socket.on("room-user-change", (clients: SocketId[]) => { this.socket.on("room-user-change", (clients: SocketId[]) => {
console.log("room-user-change", clients);
this.collab.setCollaborators(clients); this.collab.setCollaborators(clients);
}); });