Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: follow-mode tweaks (#7443)

David Luzar2c0929e537f1
diff --git a/excalidraw-app/collab/Collab.tsx b/excalidraw-app/collab/Collab.tsx
index 99fc4361ee..87b0087014 100644
--- a/excalidraw-app/collab/Collab.tsx
+++ b/excalidraw-app/collab/Collab.tsx
@@ -866,7 +866,7 @@ class Collab extends PureComponent<Props, CollabState> {
this.portal.broadcastUserViewportBounds(
{ bounds: [x1, y1, x2, y2] },
- `follow_${this.portal.socket.id}`,
+ `follow@${this.portal.socket.id}`,
);
}
};
diff --git a/packages/excalidraw/actions/actionNavigate.tsx b/packages/excalidraw/actions/actionNavigate.tsx
index 11dc221285..f4a5915de1 100644
--- a/packages/excalidraw/actions/actionNavigate.tsx
+++ b/packages/excalidraw/actions/actionNavigate.tsx
@@ -7,15 +7,8 @@ export const actionGoToCollaborator = register({
name: "goToCollaborator",
viewMode: true,
trackEvent: { category: "collab" },
- perform: (_elements, appState, value) => {
- const _value = value as Collaborator;
- const point = _value.pointer;
-
- if (!point) {
- return { appState, commitToHistory: false };
- }
-
- if (appState.userToFollow?.socketId === _value.socketId) {
+ perform: (_elements, appState, collaborator: Collaborator) => {
+ if (appState.userToFollow?.socketId === collaborator.socketId) {
return {
appState: {
...appState,
@@ -29,8 +22,8 @@ export const actionGoToCollaborator = register({
appState: {
...appState,
userToFollow: {
- socketId: _value.socketId!,
- username: _value.username || "",
+ socketId: collaborator.socketId!,
+ username: collaborator.username || "",
},
// Close mobile menu
openMenu: appState.openMenu === "canvas" ? null : appState.openMenu,