Skip to content

Commit 3de64ed

Browse files
authored
Merge pull request #1966 from dpalou/MOBILE-3039
Mobile 3039
2 parents f719d8e + 5f0eda1 commit 3de64ed

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/addon/mod/forum/providers/prefetch-handler.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,24 @@ export class AddonModForumPrefetchHandler extends CoreCourseActivityPrefetchHand
122122
});
123123
});
124124

125-
return Promise.all(promises);
125+
return Promise.all(promises).then((results) => {
126+
// Each order has returned its own list of posts. Merge all the lists, preventing duplicates.
127+
const posts = [],
128+
postIds = {}; // To make the array unique.
129+
130+
results.forEach((orderResults) => {
131+
orderResults.forEach((orderResult) => {
132+
orderResult.posts.forEach((post) => {
133+
if (!postIds[post.id]) {
134+
postIds[post.id] = true;
135+
posts.push(post);
136+
}
137+
});
138+
});
139+
});
140+
141+
return posts;
142+
});
126143
}
127144

128145
/**

src/addon/mod/glossary/pages/edit/edit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export class AddonModGlossaryEditPage implements OnInit {
8888
if (entry) {
8989
this.entry.concept = entry.concept || '';
9090
this.entry.definition = entry.definition || '';
91+
this.entry.timecreated = entry.timecreated || 0;
9192

9293
this.originalData = {
9394
concept: this.entry.concept,

0 commit comments

Comments
 (0)