Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<NcRichContenteditable ref="editor"
:auto-complete="autoComplete"
:contenteditable="!loading"
:user-data="userData"
:value="localMessage"
@update:value="updateLocalMessage"
@submit="onSubmit" />
Expand Down
13 changes: 12 additions & 1 deletion apps/comments/src/views/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
:auto-complete="autoComplete"
:editor="true"
:ressource-id="ressourceId"
:user-data="candidateMentionsData"
class="comments__writer"
@new="onNewComment" />

Expand Down Expand Up @@ -127,6 +128,7 @@ export default {
actorId: getCurrentUser().uid,
key: 'editor',
},
candidateMentionsData: {},

Comment,
}
Expand Down Expand Up @@ -251,7 +253,14 @@ export default {
limit: loadState('comments', 'maxAutoCompleteResults'),
},
})
return callback(results.data.ocs.data)

const candidateMentions = results.data.ocs.data

candidateMentions.forEach(candidateMention => {
this.candidateMentionsData[candidateMention.id] = candidateMention
})

return callback(candidateMentions)
},

/**
Expand All @@ -261,6 +270,8 @@ export default {
*/
onNewComment(comment) {
this.comments.unshift(comment)
// Reset cached candidate mentions
this.candidateMentionsData = {}
},

/**
Expand Down
4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.