aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/notification/peertube-socket.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/notification/peertube-socket.service.ts')
-rw-r--r--client/src/app/core/notification/peertube-socket.service.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/app/core/notification/peertube-socket.service.ts b/client/src/app/core/notification/peertube-socket.service.ts
index 089276cfc..bc3f7b893 100644
--- a/client/src/app/core/notification/peertube-socket.service.ts
+++ b/client/src/app/core/notification/peertube-socket.service.ts
@@ -58,9 +58,12 @@ export class PeerTubeSocket {
58 this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', { 58 this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', {
59 query: { accessToken: this.auth.getAccessToken() } 59 query: { accessToken: this.auth.getAccessToken() }
60 }) 60 })
61
62 this.notificationSocket.on('new-notification', (n: UserNotificationServer) => {
63 this.ngZone.run(() => this.dispatchNotificationEvent('new', n))
64 })
61 }) 65 })
62 66
63 this.notificationSocket.on('new-notification', (n: UserNotificationServer) => this.dispatchNotificationEvent('new', n))
64 } 67 }
65 68
66 private async initLiveVideosSocket () { 69 private async initLiveVideosSocket () {
@@ -76,7 +79,9 @@ export class PeerTubeSocket {
76 const types: LiveVideoEventType[] = [ 'views-change', 'state-change' ] 79 const types: LiveVideoEventType[] = [ 'views-change', 'state-change' ]
77 80
78 for (const type of types) { 81 for (const type of types) {
79 this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload)) 82 this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => {
83 this.ngZone.run(() => this.dispatchLiveVideoEvent(type, payload))
84 })
80 } 85 }
81 } 86 }
82 87