From 926adcf7cbe99579e6bcee46d5200c0f5f2e5dac Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 15 Mar 2019 13:20:05 +0100 Subject: [PATCH] MOBILE-2919 message: Fix auto-open discussion by userid --- .../pages/group-conversations/group-conversations.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/addon/messages/pages/group-conversations/group-conversations.ts b/src/addon/messages/pages/group-conversations/group-conversations.ts index 6dd5f0d28..b48e9401d 100644 --- a/src/addon/messages/pages/group-conversations/group-conversations.ts +++ b/src/addon/messages/pages/group-conversations/group-conversations.ts @@ -222,7 +222,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { } this.fetchData().then(() => { - if (!this.conversationId && this.splitviewCtrl.isOn()) { + if (!this.conversationId && !this.discussionUserId && this.splitviewCtrl.isOn()) { // Load the first conversation. let conversation; const expandedOption = this.getExpandedOption(); @@ -256,7 +256,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { return Promise.all(promises).then(() => { if (typeof this.favourites.expanded == 'undefined') { // The expanded status hasn't been initialized. Do it now. - if (this.conversationId) { + if (this.conversationId || this.discussionUserId) { // A certain conversation should be opened. // We don't know which option it belongs to, so we need to fetch the data for all of them. const promises = []; @@ -267,7 +267,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy { return Promise.all(promises).then(() => { // All conversations have been loaded, find the one we need to load and expand its option. - const conversation = this.findConversation(this.conversationId); + const conversation = this.findConversation(this.conversationId, this.discussionUserId); if (conversation) { const option = this.getConversationOption(conversation);