From aed159df7c23bbc537d013d3d9c3c1decd97f9c2 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 25 Feb 2021 10:00:49 +0100 Subject: [PATCH] MOBILE-3643 forum: Add rating TODOs --- src/addons/mod/forum/components/index/index.ts | 3 +++ src/addons/mod/forum/components/post/post.html | 10 ++++++++++ .../mod/forum/pages/discussion/discussion.page.ts | 4 ++++ 3 files changed, 17 insertions(+) diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index 0e2d8eb69..071a24b46 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -162,6 +162,8 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom }); } }); + + // @todo Listen for offline ratings saved and synced. } async ngAfterViewInit(): Promise { @@ -219,6 +221,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom await Promise.all([ this.fetchOfflineDiscussions(), this.fetchDiscussions(refresh), + // @todo fetch hasOfflineRatings. ]); } catch (error) { if (refresh) { diff --git a/src/addons/mod/forum/components/post/post.html b/src/addons/mod/forum/components/post/post.html index 77d4581a7..4848208cd 100644 --- a/src/addons/mod/forum/components/post/post.html +++ b/src/addons/mod/forum/components/post/post.html @@ -71,6 +71,16 @@ + + diff --git a/src/addons/mod/forum/pages/discussion/discussion.page.ts b/src/addons/mod/forum/pages/discussion/discussion.page.ts index d6bf7a2d2..d36221650 100644 --- a/src/addons/mod/forum/pages/discussion/discussion.page.ts +++ b/src/addons/mod/forum/pages/discussion/discussion.page.ts @@ -194,6 +194,8 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes AddonModForum.instance.invalidateDiscussionsList(this.forumId); } + // @todo Listen for offline ratings saved and synced. + this.changeDiscObserver = CoreEvents.on(AddonModForumProvider.CHANGE_DISCUSSION_EVENT, (data: any) => { if ((this.forumId && this.forumId === data.forumId) || data.cmId === this.cmId) { AddonModForum.instance.invalidateDiscussionsList(this.forumId).finally(() => { @@ -476,6 +478,8 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes } else { this.canPin = false; } + + // @todo fetch hasOfflineRatings. } catch (error) { CoreDomUtils.instance.showErrorModal(error); } finally {