Fix socket io messages angular changes

This commit is contained in:
Chocobozzz 2020-12-01 15:02:31 +01:00
parent a7299d9d85
commit 15feebd97a
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 8 additions and 6 deletions

View File

@ -17,7 +17,7 @@ export class PlayerPage {
}
waitUntilPlayerWrapper () {
const elem = element(by.css('#video-wrapper'))
const elem = element(by.css('#placeholder-preview'))
return browser.wait(browser.ExpectedConditions.presenceOf(elem))
}

View File

@ -53,13 +53,14 @@ export class PeerTubeSocket {
await this.importIOIfNeeded()
// Prevent protractor issues https://github.com/angular/angular/issues/11853
this.ngZone.runOutsideAngular(() => {
this.notificationSocket = this.io(environment.apiUrl + '/user-notifications', {
query: { accessToken: this.auth.getAccessToken() }
})
this.notificationSocket.on('new-notification', (n: UserNotificationServer) => this.dispatchNotificationEvent('new', n))
})
this.notificationSocket.on('new-notification', (n: UserNotificationServer) => this.dispatchNotificationEvent('new', n))
}
private async initLiveVideosSocket () {
@ -67,12 +68,13 @@ export class PeerTubeSocket {
await this.importIOIfNeeded()
// Prevent protractor issues https://github.com/angular/angular/issues/11853
this.ngZone.runOutsideAngular(() => {
this.liveVideosSocket = this.io(environment.apiUrl + '/live-videos')
const type: LiveVideoEventType = 'state-change'
this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload))
})
const type: LiveVideoEventType = 'state-change'
this.liveVideosSocket.on(type, (payload: LiveVideoEventPayload) => this.dispatchLiveVideoEvent(type, payload))
}
private async importIOIfNeeded () {