aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/menu
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-01-14 15:32:09 +0100
committerChocobozzz <me@florianbigard.com>2019-01-14 15:32:09 +0100
commit9a39392a7e6b3f180104856a4ea893e5baf86a02 (patch)
tree11c5f568d6e5a8e67fb925337c83efd57adf9111 /client/src/app/menu
parentf57ad0d22c527328b1412aa1c8c3f0d4819219ca (diff)
downloadPeerTube-9a39392a7e6b3f180104856a4ea893e5baf86a02.tar.gz
PeerTube-9a39392a7e6b3f180104856a4ea893e5baf86a02.tar.zst
PeerTube-9a39392a7e6b3f180104856a4ea893e5baf86a02.zip
Fix notification socket
Should be in core module to share the same subject to all the app
Diffstat (limited to 'client/src/app/menu')
-rw-r--r--client/src/app/menu/avatar-notification.component.html2
-rw-r--r--client/src/app/menu/avatar-notification.component.ts5
2 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/menu/avatar-notification.component.html b/client/src/app/menu/avatar-notification.component.html
index 2f0b7c669..4ef3f0e89 100644
--- a/client/src/app/menu/avatar-notification.component.html
+++ b/client/src/app/menu/avatar-notification.component.html
@@ -17,7 +17,7 @@
17 ></a> 17 ></a>
18 </div> 18 </div>
19 19
20 <my-user-notifications [ignoreLoadingBar]="true" [infiniteScroll]="false"></my-user-notifications> 20 <my-user-notifications [ignoreLoadingBar]="true" [infiniteScroll]="false" itemsPerPage="10"></my-user-notifications>
21 21
22 <a class="all-notifications" routerLink="/my-account/notifications" i18n>See all your notifications</a> 22 <a class="all-notifications" routerLink="/my-account/notifications" i18n>See all your notifications</a>
23</ng-template> 23</ng-template>
diff --git a/client/src/app/menu/avatar-notification.component.ts b/client/src/app/menu/avatar-notification.component.ts
index 60e090726..f1af08096 100644
--- a/client/src/app/menu/avatar-notification.component.ts
+++ b/client/src/app/menu/avatar-notification.component.ts
@@ -2,7 +2,7 @@ import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { User } from '../shared/users/user.model' 2import { User } from '../shared/users/user.model'
3import { UserNotificationService } from '@app/shared/users/user-notification.service' 3import { UserNotificationService } from '@app/shared/users/user-notification.service'
4import { Subscription } from 'rxjs' 4import { Subscription } from 'rxjs'
5import { Notifier } from '@app/core' 5import { Notifier, UserNotificationSocket } from '@app/core'
6import { NgbPopover } from '@ng-bootstrap/ng-bootstrap' 6import { NgbPopover } from '@ng-bootstrap/ng-bootstrap'
7import { NavigationEnd, Router } from '@angular/router' 7import { NavigationEnd, Router } from '@angular/router'
8import { filter } from 'rxjs/operators' 8import { filter } from 'rxjs/operators'
@@ -23,6 +23,7 @@ export class AvatarNotificationComponent implements OnInit, OnDestroy {
23 23
24 constructor ( 24 constructor (
25 private userNotificationService: UserNotificationService, 25 private userNotificationService: UserNotificationService,
26 private userNotificationSocket: UserNotificationSocket,
26 private notifier: Notifier, 27 private notifier: Notifier,
27 private router: Router 28 private router: Router
28 ) {} 29 ) {}
@@ -53,7 +54,7 @@ export class AvatarNotificationComponent implements OnInit, OnDestroy {
53 } 54 }
54 55
55 private subscribeToNotifications () { 56 private subscribeToNotifications () {
56 this.notificationSub = this.userNotificationService.getMyNotificationsSocket() 57 this.notificationSub = this.userNotificationSocket.getMyNotificationsSocket()
57 .subscribe(data => { 58 .subscribe(data => {
58 if (data.type === 'new') return this.unreadNotifications++ 59 if (data.type === 'new') return this.unreadNotifications++
59 if (data.type === 'read') return this.unreadNotifications-- 60 if (data.type === 'read') return this.unreadNotifications--