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> { async ngOnInit(): Promise<void> {
this.route.queryParams.subscribe(async (params) => { this.route.queryParams.subscribe(async (params) => {
// When a child page loads this callback is triggered too. // When a child page loads this callback is triggered too.
this.selectedConversationId = const conversationId =CoreNavigator.getRouteNumberParam('conversationId', { params });
CoreNavigator.getRouteNumberParam('conversationId', { params }) ?? this.selectedConversationId; const userId = CoreNavigator.getRouteNumberParam('userId', { params });
this.selectedUserId = if (conversationId || userId) {
CoreNavigator.getRouteNumberParam('userId', { params }) ?? this.selectedUserId; // Update the selected ones.
this.selectedConversationId = conversationId;
this.selectedUserId = userId;
}
}); });
await this.fetchData(); await this.fetchData();