MOBILE-2919 message: Fix auto-open discussion by userid

main
Dani Palou 2019-03-15 13:20:05 +01:00
parent f94b1a34e7
commit 926adcf7cb
1 changed files with 3 additions and 3 deletions

View File

@ -222,7 +222,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
} }
this.fetchData().then(() => { this.fetchData().then(() => {
if (!this.conversationId && this.splitviewCtrl.isOn()) { if (!this.conversationId && !this.discussionUserId && this.splitviewCtrl.isOn()) {
// Load the first conversation. // Load the first conversation.
let conversation; let conversation;
const expandedOption = this.getExpandedOption(); const expandedOption = this.getExpandedOption();
@ -256,7 +256,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
return Promise.all(promises).then(() => { return Promise.all(promises).then(() => {
if (typeof this.favourites.expanded == 'undefined') { if (typeof this.favourites.expanded == 'undefined') {
// The expanded status hasn't been initialized. Do it now. // The expanded status hasn't been initialized. Do it now.
if (this.conversationId) { if (this.conversationId || this.discussionUserId) {
// A certain conversation should be opened. // 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. // We don't know which option it belongs to, so we need to fetch the data for all of them.
const promises = []; const promises = [];
@ -267,7 +267,7 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
return Promise.all(promises).then(() => { return Promise.all(promises).then(() => {
// All conversations have been loaded, find the one we need to load and expand its option. // 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) { if (conversation) {
const option = this.getConversationOption(conversation); const option = this.getConversationOption(conversation);