From e95bdb4d49f1f31890eaa271b6f94e3b48bd2306 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 12 Jul 2021 16:54:18 +0200 Subject: [PATCH] MOBILE-3320 forum: Fix nested subjects --- src/addons/mod/forum/pages/discussion/discussion.page.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/addons/mod/forum/pages/discussion/discussion.page.ts b/src/addons/mod/forum/pages/discussion/discussion.page.ts index e85857e4a..c9b89e9c6 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.page.ts +++ b/src/addons/mod/forum/pages/discussion/discussion.page.ts @@ -29,6 +29,7 @@ import { CoreSites } from '@services/sites'; import { CoreDomUtils } from '@services/utils/dom'; import { CoreUtils } from '@services/utils/utils'; import { Network, NgZone, Translate } from '@singletons'; +import { CoreArray } from '@singletons/array'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { Subscription } from 'rxjs'; import { @@ -771,7 +772,9 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes * @return Array containing all the posts of the discussion. */ protected getAllPosts(): Post[] { - return this.posts.map(this.flattenPostHierarchy.bind(this)); + const allPosts = this.posts.map(post => this.flattenPostHierarchy(post)); + + return CoreArray.flatten(allPosts); } /**