diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-01 15:02:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-01 15:04:38 +0100 |
commit | 15feebd97ab5291f81b2a8cdcb16a8e4f4c5aa69 (patch) | |
tree | e8b4b9527861fbbfd8132d6e95bd7569601fe844 /client/src | |
parent | a7299d9d855caf11d8bb0bab1b1b5e0fb19d9476 (diff) | |
download | PeerTube-15feebd97ab5291f81b2a8cdcb16a8e4f4c5aa69.tar.gz PeerTube-15feebd97ab5291f81b2a8cdcb16a8e4f4c5aa69.tar.zst PeerTube-15feebd97ab5291f81b2a8cdcb16a8e4f4c5aa69.zip |
Fix socket io messages angular changes
Diffstat (limited to 'client/src')
-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 () { |