Add action hook, comments loaded (#2539)
authorChocobozzz <chocobozzz@cpy.re>
Thu, 5 Mar 2020 12:14:26 +0000 (13:14 +0100)
committerGitHub <noreply@github.com>
Thu, 5 Mar 2020 12:14:26 +0000 (13:14 +0100)
* Adding action hook for video watch comments loaded

* Adding requested changes for PR #2539

client/src/app/videos/+video-watch/comment/video-comments.component.ts
shared/models/plugins/client-hook.model.ts

index a87bc16d7347fabe08d04d0104dea6c321acad22..910a1761c9e5af8d9d59d6b6779f20f0b6b8bafe 100644 (file)
@@ -130,6 +130,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
         this.componentPagination.totalItems = res.total
 
         this.onDataSubject.next(res.data)
+        this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination })
       },
 
       err => this.notifier.error(err.message)
index ecbe8bd3c8e1e92e35d7efca5e50021e3dd0fc72..fc36e5771c6d9be49848100695b1edd90f02e20b 100644 (file)
@@ -65,6 +65,8 @@ export const clientActionHookObject = {
   'action:video-watch.video.loaded': true,
   // Fired when the player finished loading
   'action:video-watch.player.loaded': true,
+  // Fired when the video watch page comments(threads) are loaded and load more comments on scroll
+  'action:video-watch.video-threads.loaded': true,
 
   // Fired when the search page is being initialized
   'action:search.init': true,