From 879792ac11ca8d15d482deca0d24f99bc9e430b3 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 29 Mar 2019 11:05:46 +0100 Subject: [PATCH] MOBILE-2915 messages: Fix error if push clicked in discs view --- .../messages/components/discussions/discussions.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/addon/messages/components/discussions/discussions.ts b/src/addon/messages/components/discussions/discussions.ts index afb9b5d88..b072b719b 100644 --- a/src/addon/messages/components/discussions/discussions.ts +++ b/src/addon/messages/components/discussions/discussions.ts @@ -92,8 +92,8 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { discussion.unread = false; // Conversations changed, invalidate them and refresh unread counts. - this.messagesProvider.invalidateConversations(); - this.messagesProvider.refreshUnreadConversationCounts(); + this.messagesProvider.invalidateConversations(this.siteId); + this.messagesProvider.refreshUnreadConversationCounts(this.siteId); } } }, this.siteId); @@ -145,10 +145,10 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { */ refreshData(refresher?: any, refreshUnreadCounts: boolean = true): Promise { const promises = []; - promises.push(this.messagesProvider.invalidateDiscussionsCache()); + promises.push(this.messagesProvider.invalidateDiscussionsCache(this.siteId)); if (refreshUnreadCounts) { - promises.push(this.messagesProvider.invalidateUnreadConversationCounts()); + promises.push(this.messagesProvider.invalidateUnreadConversationCounts(this.siteId)); } return this.utils.allPromises(promises).finally(() => { @@ -171,7 +171,7 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { const promises = []; - promises.push(this.messagesProvider.getDiscussions().then((discussions) => { + promises.push(this.messagesProvider.getDiscussions(this.siteId).then((discussions) => { // Convert to an array for sorting. const discussionsSorted = []; for (const userId in discussions) { @@ -184,7 +184,7 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { }); })); - promises.push(this.messagesProvider.getUnreadConversationCounts()); + promises.push(this.messagesProvider.getUnreadConversationCounts(this.siteId)); return Promise.all(promises).catch((error) => { this.domUtils.showErrorModalDefault(error, 'addon.messages.errorwhileretrievingdiscussions', true); @@ -216,7 +216,7 @@ export class AddonMessagesDiscussionsComponent implements OnDestroy { this.loaded = false; this.loadingMessage = this.search.loading; - return this.messagesProvider.searchMessages(query).then((searchResults) => { + return this.messagesProvider.searchMessages(query, undefined, undefined, undefined, this.siteId).then((searchResults) => { this.search.showResults = true; this.search.results = searchResults.messages; }).catch((error) => {