diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-25 10:04:21 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | a5cf76afa378aae81af2a9b0ce548e5d2582f832 (patch) | |
tree | 58da320232bee7c9656774c5d6811e82bbf6c696 /client/src/app/shared/shared-main/users | |
parent | de6310b2fcbb8a6b79c546b23dfa1920724faaa7 (diff) | |
download | PeerTube-a5cf76afa378aae81af2a9b0ce548e5d2582f832.tar.gz PeerTube-a5cf76afa378aae81af2a9b0ce548e5d2582f832.tar.zst PeerTube-a5cf76afa378aae81af2a9b0ce548e5d2582f832.zip |
Add watch messages if live has not started
Diffstat (limited to 'client/src/app/shared/shared-main/users')
-rw-r--r-- | client/src/app/shared/shared-main/users/user-notification.service.ts | 10 |
1 files changed, 5 insertions, 5 deletions
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 @@ | |||
1 | import { catchError, map, tap } from 'rxjs/operators' | 1 | import { catchError, map, tap } from 'rxjs/operators' |
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ComponentPaginationLight, RestExtractor, RestService, User, UserNotificationSocket, AuthService } from '@app/core' | 4 | import { ComponentPaginationLight, RestExtractor, RestService, User, PeerTubeSocket, AuthService } from '@app/core' |
5 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' | 5 | import { ResultList, UserNotification as UserNotificationServer, UserNotificationSetting } from '@shared/models' |
6 | import { environment } from '../../../../environments/environment' | 6 | import { environment } from '../../../../environments/environment' |
7 | import { UserNotification } from './user-notification.model' | 7 | import { UserNotification } from './user-notification.model' |
@@ -17,7 +17,7 @@ export class UserNotificationService { | |||
17 | private auth: AuthService, | 17 | private auth: AuthService, |
18 | private restExtractor: RestExtractor, | 18 | private restExtractor: RestExtractor, |
19 | private restService: RestService, | 19 | private restService: RestService, |
20 | private userNotificationSocket: UserNotificationSocket | 20 | private peertubeSocket: PeerTubeSocket |
21 | ) {} | 21 | ) {} |
22 | 22 | ||
23 | listMyNotifications (parameters: { | 23 | listMyNotifications (parameters: { |
@@ -57,7 +57,7 @@ export class UserNotificationService { | |||
57 | return this.authHttp.post(url, body, { headers }) | 57 | return this.authHttp.post(url, body, { headers }) |
58 | .pipe( | 58 | .pipe( |
59 | map(this.restExtractor.extractDataBool), | 59 | map(this.restExtractor.extractDataBool), |
60 | tap(() => this.userNotificationSocket.dispatch('read')), | 60 | tap(() => this.peertubeSocket.dispatchNotificationEvent('read')), |
61 | catchError(res => this.restExtractor.handleError(res)) | 61 | catchError(res => this.restExtractor.handleError(res)) |
62 | ) | 62 | ) |
63 | } | 63 | } |
@@ -69,12 +69,12 @@ export class UserNotificationService { | |||
69 | return this.authHttp.post(url, {}, { headers }) | 69 | return this.authHttp.post(url, {}, { headers }) |
70 | .pipe( | 70 | .pipe( |
71 | map(this.restExtractor.extractDataBool), | 71 | map(this.restExtractor.extractDataBool), |
72 | tap(() => this.userNotificationSocket.dispatch('read-all')), | 72 | tap(() => this.peertubeSocket.dispatchNotificationEvent('read-all')), |
73 | catchError(res => this.restExtractor.handleError(res)) | 73 | catchError(res => this.restExtractor.handleError(res)) |
74 | ) | 74 | ) |
75 | } | 75 | } |
76 | 76 | ||
77 | updateNotificationSettings (user: User, settings: UserNotificationSetting) { | 77 | updateNotificationSettings (settings: UserNotificationSetting) { |
78 | const url = UserNotificationService.BASE_NOTIFICATION_SETTINGS | 78 | const url = UserNotificationService.BASE_NOTIFICATION_SETTINGS |
79 | 79 | ||
80 | return this.authHttp.put(url, settings) | 80 | return this.authHttp.put(url, settings) |