From befee634ff62e9a3e36b666f8095f0d6f6764469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 22 Feb 2022 17:03:41 +0100 Subject: [PATCH] MOBILE-3833 forum: Fix hasOffline flag on index page. --- src/addons/mod/forum/components/index/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index 40fda05ae..55ac9daaa 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -174,7 +174,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom // Check if there are replies for discussions stored in offline. const hasOffline = await AddonModForumOffline.hasForumReplies(this.forum.id); - this.hasOffline = this.hasOffline || hasOffline; + this.hasOffline = this.hasOffline || hasOffline || this.hasOfflineRatings; if (hasOffline) { // Only update new fetched discussions. @@ -258,6 +258,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom if (this.forum && data.component == 'mod_forum' && data.ratingArea == 'post' && data.contextLevel == ContextLevel.MODULE && data.instanceId == this.forum.cmid) { this.hasOfflineRatings = true; + this.hasOffline = true; } }); @@ -266,6 +267,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom data.contextLevel == ContextLevel.MODULE && data.instanceId == this.forum.cmid) { this.hasOfflineRatings = await CoreRatingOffline.hasRatings('mod_forum', 'post', ContextLevel.MODULE, this.forum.cmid); + this.hasOffline = this.hasOffline || this.hasOfflineRatings; } }); }