MOBILE-3320 messages: Fix two conversations selected after clickin push

main
Dani Palou 2021-06-30 13:31:30 +02:00
parent f0a2ff7fe4
commit 92e054e3dd
1 changed files with 7 additions and 4 deletions

View File

@ -270,10 +270,13 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
async ngOnInit(): Promise<void> {
this.route.queryParams.subscribe(async (params) => {
// When a child page loads this callback is triggered too.
this.selectedConversationId =
CoreNavigator.getRouteNumberParam('conversationId', { params }) ?? this.selectedConversationId;
this.selectedUserId =
CoreNavigator.getRouteNumberParam('userId', { params }) ?? this.selectedUserId;
const conversationId =CoreNavigator.getRouteNumberParam('conversationId', { params });
const userId = CoreNavigator.getRouteNumberParam('userId', { params });
if (conversationId || userId) {
// Update the selected ones.
this.selectedConversationId = conversationId;
this.selectedUserId = userId;
}
});
await this.fetchData();