Skip to content

Commit d88a9ab

Browse files
committed
fix(CollaborationCaret): Use user from awareness provider localState
Use user from awareness localState instead of `this.options.user` as `this.options` is a getter these days and doesn't get updated after the initialization. Signed-off-by: Jonas <jonas@freesources.org>
1 parent bd2086f commit d88a9ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/extensions/CollaborationCaret.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const CollaborationCaret = TiptapCollaborationCaret.extend({
7878
) => {
7979
if (origin !== 'local') {
8080
for (const clientId of [...added, ...updated]) {
81-
if (clientId !== this.options.user.clientID) {
81+
if (clientId !== this.options.provider.awareness.clientID) {
8282
showCaretLabel(clientId)
8383
}
8484
}
@@ -94,7 +94,7 @@ const CollaborationCaret = TiptapCollaborationCaret.extend({
9494
const updated = transaction.docChanged
9595
if (updated && addToHistory && !pointer) {
9696
editor.commands.updateUser({
97-
...this.options.user,
97+
...this.options.provider.awareness.getLocalState().user,
9898
lastUpdate: getTimestamp(),
9999
})
100100
}

0 commit comments

Comments
 (0)