From f24ab4e4b1b3018c3f464d15f8e822d178faba25 Mon Sep 17 00:00:00 2001 From: Albert Gasset Date: Mon, 27 May 2019 11:24:32 +0200 Subject: [PATCH] MOBILE-3018 forum: Fix error after creating discussion --- src/addon/mod/forum/components/index/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/addon/mod/forum/components/index/index.ts b/src/addon/mod/forum/components/index/index.ts index 973b3efd7..b3a4209b6 100644 --- a/src/addon/mod/forum/components/index/index.ts +++ b/src/addon/mod/forum/components/index/index.ts @@ -475,9 +475,11 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom // If it's a new discussion in tablet mode, try to open it. if (isNewDiscussion && this.splitviewCtrl.isOn()) { - if (data.discussionId) { + if (data.discussionIds) { // Discussion sent to server, search it in the list of discussions. - const discussion = this.discussions.find((disc) => { return disc.discussion == data.discussionId; }); + const discussion = this.discussions.find((disc) => { + return data.discussionIds.indexOf(disc.discussion) >= 0; + }); if (discussion) { this.openDiscussion(discussion); }