diff options
author | Chocobozzz <chocobozzz@cpy.re> | 2020-03-05 13:14:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-05 13:14:26 +0100 |
commit | 0840ca76a2de3a2907aa64c2cdaf3d2c69b691c2 (patch) | |
tree | e4a7332d5302a7334a4bb6b108cd293a0f55f236 | |
parent | 52e3beb90d690061847a483fed798c0e10971cba (diff) | |
download | PeerTube-0840ca76a2de3a2907aa64c2cdaf3d2c69b691c2.tar.gz PeerTube-0840ca76a2de3a2907aa64c2cdaf3d2c69b691c2.tar.zst PeerTube-0840ca76a2de3a2907aa64c2cdaf3d2c69b691c2.zip |
Add action hook, comments loaded (#2539)
* Adding action hook for video watch comments loaded
* Adding requested changes for PR #2539
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comments.component.ts | 1 | ||||
-rw-r--r-- | shared/models/plugins/client-hook.model.ts | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts index a87bc16d7..910a1761c 100644 --- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts | |||
@@ -130,6 +130,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
130 | this.componentPagination.totalItems = res.total | 130 | this.componentPagination.totalItems = res.total |
131 | 131 | ||
132 | this.onDataSubject.next(res.data) | 132 | this.onDataSubject.next(res.data) |
133 | this.hooks.runAction('action:video-watch.video-threads.loaded', 'video-watch', { data: this.componentPagination }) | ||
133 | }, | 134 | }, |
134 | 135 | ||
135 | err => this.notifier.error(err.message) | 136 | err => this.notifier.error(err.message) |
diff --git a/shared/models/plugins/client-hook.model.ts b/shared/models/plugins/client-hook.model.ts index ecbe8bd3c..fc36e5771 100644 --- a/shared/models/plugins/client-hook.model.ts +++ b/shared/models/plugins/client-hook.model.ts | |||
@@ -65,6 +65,8 @@ export const clientActionHookObject = { | |||
65 | 'action:video-watch.video.loaded': true, | 65 | 'action:video-watch.video.loaded': true, |
66 | // Fired when the player finished loading | 66 | // Fired when the player finished loading |
67 | 'action:video-watch.player.loaded': true, | 67 | 'action:video-watch.player.loaded': true, |
68 | // Fired when the video watch page comments(threads) are loaded and load more comments on scroll | ||
69 | 'action:video-watch.video-threads.loaded': true, | ||
68 | 70 | ||
69 | // Fired when the search page is being initialized | 71 | // Fired when the search page is being initialized |
70 | 'action:search.init': true, | 72 | 'action:search.init': true, |