parent
61d56922d5
commit
e2c80e5a28
|
@ -65,7 +65,6 @@ class AvatarWithPresence extends React.Component<Props> {
|
|||
: this.handleOpenProfile
|
||||
}
|
||||
size={32}
|
||||
icon={isEditing ? <EditIcon size={16} color="#FFF" /> : undefined}
|
||||
/>
|
||||
</AvatarWrapper>
|
||||
</Tooltip>
|
||||
|
|
|
@ -65,12 +65,12 @@ function MultiplayerEditor({ ...props }: Props, ref: any) {
|
|||
});
|
||||
|
||||
provider.on("awarenessChange", ({ states }) => {
|
||||
states.forEach(({ user }) => {
|
||||
states.forEach(({ user, cursor }) => {
|
||||
if (user) {
|
||||
// could know if the user is editing here using `state.cursor` but it
|
||||
// feels distracting in the UI, once multiplayer is on for everyone we
|
||||
// can stop diffentiating
|
||||
presence.touch(documentId, user.id, false);
|
||||
presence.touch(documentId, user.id, !!cursor);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -105,7 +105,17 @@ function MultiplayerEditor({ ...props }: Props, ref: any) {
|
|||
|
||||
ui.setMultiplayerStatus(undefined);
|
||||
};
|
||||
}, [history, showToast, t, documentId, ui, presence, token, ydoc]);
|
||||
}, [
|
||||
history,
|
||||
showToast,
|
||||
t,
|
||||
documentId,
|
||||
ui,
|
||||
presence,
|
||||
token,
|
||||
ydoc,
|
||||
currentUser.id,
|
||||
]);
|
||||
|
||||
const user = React.useMemo(() => {
|
||||
return {
|
||||
|
|
Reference in New Issue