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
19 changes: 18 additions & 1 deletion src/addon/mod/forum/providers/prefetch-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,24 @@ export class AddonModForumPrefetchHandler extends CoreCourseActivityPrefetchHand
});
});

return Promise.all(promises);
return Promise.all(promises).then((results) => {
// Each order has returned its own list of posts. Merge all the lists, preventing duplicates.
const posts = [],
postIds = {}; // To make the array unique.

results.forEach((orderResults) => {
orderResults.forEach((orderResult) => {
orderResult.posts.forEach((post) => {
if (!postIds[post.id]) {
postIds[post.id] = true;
posts.push(post);
}
});
});
});

return posts;
});
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/addon/mod/glossary/pages/edit/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class AddonModGlossaryEditPage implements OnInit {
if (entry) {
this.entry.concept = entry.concept || '';
this.entry.definition = entry.definition || '';
this.entry.timecreated = entry.timecreated || 0;

this.originalData = {
concept: this.entry.concept,
Expand Down