MOBILE-3039 forum: Load subject when avalaible

main
Pau Ferrer Ocaña 2019-05-28 09:42:47 +02:00
parent eb01a001bc
commit a7e391bd1e
1 changed files with 4 additions and 2 deletions

View File

@ -299,8 +299,6 @@ export class AddonModForumDiscussionPage implements OnDestroy {
const direction = this.sort == 'flat-newest' ? 'DESC' : 'ASC';
this.forumProvider.sortDiscussionPosts(posts, direction);
}
this.defaultSubject = this.translate.instant('addon.mod_forum.re') + ' ' + this.discussion.subject;
this.replyData.subject = this.defaultSubject;
// Now try to get the forum.
return this.fetchForum().then((forum) => {
@ -343,6 +341,10 @@ export class AddonModForumDiscussionPage implements OnDestroy {
this.forum = {};
this.accessInfo = {};
}).then(() => {
this.defaultSubject = this.translate.instant('addon.mod_forum.re') + ' ' +
(this.discussion ? this.discussion.subject : "");
this.replyData.subject = this.defaultSubject;
const startingPost = this.forumProvider.extractStartingPost(posts);
if (startingPost) {
// Update discussion data from first post.