From a5cf76afa378aae81af2a9b0ce548e5d2582f832 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 Sep 2020 10:04:21 +0200 Subject: Add watch messages if live has not started --- .../app/shared/shared-main/users/user-notification.service.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client/src/app/shared/shared-main/users') diff --git a/client/src/app/shared/shared-main/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts index 7b9dc34be..9014b48a8 100644 --- a/client/src/app/shared/shared-main/users/user-notification.service.ts +++ b/client/src/app/shared/shared-main/users/user-notification.service.ts @@ -1,7 +1,7 @@ import { catchError, map, tap } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' -import { ComponentPaginationLight, RestExtractor, RestService, User, UserNotificationSocket, AuthService } from '@app/core' +import { ComponentPaginationLight, RestExtractor, RestService, User, PeerTubeSocket, AuthService } from '@app/core' import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' import { environment } from '../../../../environments/environment' import { UserNotification } from './user-notification.model' @@ -17,7 +17,7 @@ export class UserNotificationService { private auth: AuthService, private restExtractor: RestExtractor, private restService: RestService, - private userNotificationSocket: UserNotificationSocket + private peertubeSocket: PeerTubeSocket ) {} listMyNotifications (parameters: { @@ -57,7 +57,7 @@ export class UserNotificationService { return this.authHttp.post(url, body, { headers }) .pipe( map(this.restExtractor.extractDataBool), - tap(() => this.userNotificationSocket.dispatch('read')), + tap(() => this.peertubeSocket.dispatchNotificationEvent('read')), catchError(res => this.restExtractor.handleError(res)) ) } @@ -69,12 +69,12 @@ export class UserNotificationService { return this.authHttp.post(url, {}, { headers }) .pipe( map(this.restExtractor.extractDataBool), - tap(() => this.userNotificationSocket.dispatch('read-all')), + tap(() => this.peertubeSocket.dispatchNotificationEvent('read-all')), catchError(res => this.restExtractor.handleError(res)) ) } - updateNotificationSettings (user: User, settings: UserNotificationSetting) { + updateNotificationSettings (settings: UserNotificationSetting) { const url = UserNotificationService.BASE_NOTIFICATION_SETTINGS return this.authHttp.put(url, settings) -- cgit v1.2.3