fix: follow-mode tweaks (#7443)
This commit is contained in:
parent
aad8ab0123
commit
2c0929e537
@ -866,7 +866,7 @@ class Collab extends PureComponent<Props, CollabState> {
|
|||||||
|
|
||||||
this.portal.broadcastUserViewportBounds(
|
this.portal.broadcastUserViewportBounds(
|
||||||
{ bounds: [x1, y1, x2, y2] },
|
{ bounds: [x1, y1, x2, y2] },
|
||||||
`follow_${this.portal.socket.id}`,
|
`follow@${this.portal.socket.id}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -7,15 +7,8 @@ export const actionGoToCollaborator = register({
|
|||||||
name: "goToCollaborator",
|
name: "goToCollaborator",
|
||||||
viewMode: true,
|
viewMode: true,
|
||||||
trackEvent: { category: "collab" },
|
trackEvent: { category: "collab" },
|
||||||
perform: (_elements, appState, value) => {
|
perform: (_elements, appState, collaborator: Collaborator) => {
|
||||||
const _value = value as Collaborator;
|
if (appState.userToFollow?.socketId === collaborator.socketId) {
|
||||||
const point = _value.pointer;
|
|
||||||
|
|
||||||
if (!point) {
|
|
||||||
return { appState, commitToHistory: false };
|
|
||||||
}
|
|
||||||
|
|
||||||
if (appState.userToFollow?.socketId === _value.socketId) {
|
|
||||||
return {
|
return {
|
||||||
appState: {
|
appState: {
|
||||||
...appState,
|
...appState,
|
||||||
@ -29,8 +22,8 @@ export const actionGoToCollaborator = register({
|
|||||||
appState: {
|
appState: {
|
||||||
...appState,
|
...appState,
|
||||||
userToFollow: {
|
userToFollow: {
|
||||||
socketId: _value.socketId!,
|
socketId: collaborator.socketId!,
|
||||||
username: _value.username || "",
|
username: collaborator.username || "",
|
||||||
},
|
},
|
||||||
// Close mobile menu
|
// Close mobile menu
|
||||||
openMenu: appState.openMenu === "canvas" ? null : appState.openMenu,
|
openMenu: appState.openMenu === "canvas" ? null : appState.openMenu,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user