Procházet zdrojové kódy

fix: get socketId from emitted message

Arnošt Pleskot před 2 roky
rodič
revize
c4ff0594e3
1 změnil soubory, kde provedl 12 přidání a 3 odebrání
  1. 12 3
      src/excalidraw-app/collab/Collab.tsx

+ 12 - 3
src/excalidraw-app/collab/Collab.tsx

@@ -656,8 +656,14 @@ class Collab extends PureComponent<Props, CollabState> {
             );
             break;
           case "MOUSE_LOCATION": {
-            const { pointer, button, username, selectedElementIds, userId } =
-              decryptedData.payload;
+            const {
+              pointer,
+              button,
+              username,
+              selectedElementIds,
+              userId,
+              socketId,
+            } = decryptedData.payload;
             const collaborators = upsertMap(
               userId,
               {
@@ -665,6 +671,7 @@ class Collab extends PureComponent<Props, CollabState> {
                 pointer,
                 button,
                 selectedElementIds,
+                socketId,
               },
               this.collaborators,
             );
@@ -674,13 +681,15 @@ class Collab extends PureComponent<Props, CollabState> {
             break;
           }
           case "IDLE_STATUS": {
-            const { userState, username, userId } = decryptedData.payload;
+            const { userState, username, userId, socketId } =
+              decryptedData.payload;
             const collaborators = upsertMap(
               userId,
               {
                 username,
                 userState,
                 userId,
+                socketId,
               },
               this.collaborators,
             );