diff options
Diffstat (limited to 'client/src/app/core/notification/peertube-socket.service.ts')
-rw-r--r-- | client/src/app/core/notification/peertube-socket.service.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/client/src/app/core/notification/peertube-socket.service.ts b/client/src/app/core/notification/peertube-socket.service.ts index 2f17fd709..7e1c43364 100644 --- a/client/src/app/core/notification/peertube-socket.service.ts +++ b/client/src/app/core/notification/peertube-socket.service.ts | |||
@@ -53,13 +53,14 @@ export class PeerTubeSocket { | |||
53 | 53 | ||
54 | await this.importIOIfNeeded() | 54 | await this.importIOIfNeeded() |
55 | 55 | ||
56 | // Prevent protractor issues https://github.com/angular/angular/issues/11853 | ||
56 | this.ngZone.runOutsideAngular(() => { | 57 | this.ngZone.runOutsideAngular(() => { |
57 | this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', { | 58 | this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', { |
58 | query: { accessToken: this.auth.getAccessToken() } | 59 | query: { accessToken: this.auth.getAccessToken() } |
59 | }) | 60 | }) |
60 | |||
61 | this.notificationSocket.on('new-notification', (n: UserNotificationServer) => this.dispatchNotificationEvent('new', n)) | ||
62 | }) | 61 | }) |
62 | |||
63 | this.notificationSocket.on('new-notification', (n: UserNotificationServer) => this.dispatchNotificationEvent('new', n)) | ||
63 | } | 64 | } |
64 | 65 | ||
65 | private async initLiveVideosSocket () { | 66 | private async initLiveVideosSocket () { |
@@ -67,12 +68,13 @@ export class PeerTubeSocket { | |||
67 | 68 | ||
68 | await this.importIOIfNeeded() | 69 | await this.importIOIfNeeded() |
69 | 70 | ||
71 | // Prevent protractor issues https://github.com/angular/angular/issues/11853 | ||
70 | this.ngZone.runOutsideAngular(() => { | 72 | this.ngZone.runOutsideAngular(() => { |
71 | this.liveVideosSocket = this.io(environment.apiUrl + '/live-videos') | 73 | this.liveVideosSocket = this.io(environment.apiUrl + '/live-videos') |
72 | |||
73 | const type: LiveVideoEventType = 'state-change' | ||
74 | this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload)) | ||
75 | }) | 74 | }) |
75 | |||
76 | const type: LiveVideoEventType = 'state-change' | ||
77 | this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload)) | ||
76 | } | 78 | } |
77 | 79 | ||
78 | private async importIOIfNeeded () { | 80 | private async importIOIfNeeded () { |