Action hook: thread replies loaded (#2550)
authorBitTube <hello@bittube.app>
Wed, 11 Mar 2020 08:59:41 +0000 (08:59 +0000)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2020 08:59:41 +0000 (09:59 +0100)
* Add thread replies hook onLoaded

* Cleaning spaces

* Fixing travis CI lint errors (spaces)

* Fixing travis 'irregular whitespace not allowed'

* Changing action name for consistency

Co-authored-by: ICabaleiro <i.cabaleiro@devcups.com>
client/src/app/videos/+video-watch/comment/video-comments.component.ts
shared/models/plugins/client-hook.model.ts

index ba59e0a1d514843cf6d616b5731b9892c8a2a962..f2bb5c4648d8996a872e52755179b0a707b1e774 100644 (file)
@@ -96,6 +96,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
         res => {
           this.threadComments[commentId] = res
           this.threadLoading[commentId] = false
+          this.hooks.runAction('action:video-watch.video-thread-replies.loaded', 'video-watch', { data: res })
 
           if (highlightThread) {
             this.highlightedThread = new VideoComment(res.comment)
index fc36e5771c6d9be49848100695b1edd90f02e20b..62f6070d796f51d35601e26c2aebfb408453b049 100644 (file)
@@ -67,6 +67,8 @@ export const clientActionHookObject = {
   '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 a user click on 'View x replies' and they're loaded
+  'action:video-watch.video-thread-replies.loaded': true,
 
   // Fired when the search page is being initialized
   'action:search.init': true,