Skip to content
Merged
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
4 changes: 4 additions & 0 deletions apps/comments/lib/Collaboration/CommentersSorter.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public function getId(): string {
* @param array $context
*/
public function sort(array &$sortArray, array $context): void {
if (!isset($context['itemType'], $context['itemId'])) {
return;
}

$commenters = $this->retrieveCommentsInformation($context['itemType'], $context['itemId']);
if (count($commenters) === 0) {
return;
Expand Down
5 changes: 3 additions & 2 deletions apps/comments/src/mixins/CommentView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default defineComponent({
key: 'editor',
},
userData: {},
currentResourceId: this.resourceId,
}
},
methods: {
Expand All @@ -40,8 +41,8 @@ export default defineComponent({
const { data } = await axios.get(generateOcsUrl('core/autocomplete/get'), {
params: {
search,
itemType: 'files',
itemId: this.resourceId,
itemType: this.resourceType,
itemId: this.currentResourceId,
sorter: 'commenters|share-recipients',
limit: loadState('comments', 'maxAutoCompleteResults'),
},
Expand Down
10 changes: 7 additions & 3 deletions apps/comments/src/views/Comments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export default {
loading: false,
done: false,

currentResourceId: this.resourceId,
offset: 0,
comments: [],

Expand Down Expand Up @@ -153,7 +152,7 @@ export default {
async update(resourceId) {
this.currentResourceId = resourceId
this.resetState()
this.getComments()
await this.getComments()
},

/**
Expand Down Expand Up @@ -201,8 +200,13 @@ export default {
this.done = true
}

// Ensure actor id is a string
for (const comment of comments) {
comment.props.actorId = comment.props.actorId.toString()
}

// Insert results
this.comments.push(...comments)
this.comments = [...this.comments, ...comments]

// Increase offset for next fetch
this.offset += DEFAULT_LIMIT
Expand Down
4 changes: 2 additions & 2 deletions dist/7462-7462.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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.

4 changes: 2 additions & 2 deletions dist/comments-comments-tab.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

Loading