From e2c80e5a28603f97492ecc8b374ad6b44eecb071 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 29 Oct 2021 23:04:23 -0700 Subject: [PATCH] fix: Correctly show editing tooltip Remove edit icon closes #2705 --- app/components/Avatar/AvatarWithPresence.js | 1 - .../Document/components/MultiplayerEditor.js | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/components/Avatar/AvatarWithPresence.js b/app/components/Avatar/AvatarWithPresence.js index 300da5ecc..24f5d6965 100644 --- a/app/components/Avatar/AvatarWithPresence.js +++ b/app/components/Avatar/AvatarWithPresence.js @@ -65,7 +65,6 @@ class AvatarWithPresence extends React.Component { : this.handleOpenProfile } size={32} - icon={isEditing ? : undefined} /> diff --git a/app/scenes/Document/components/MultiplayerEditor.js b/app/scenes/Document/components/MultiplayerEditor.js index c6782bd08..f1e2a688b 100644 --- a/app/scenes/Document/components/MultiplayerEditor.js +++ b/app/scenes/Document/components/MultiplayerEditor.js @@ -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 {