- private subscribeToNotifications () {
- this.notificationSub = this.userNotificationSocket.getMyNotificationsSocket()
- .subscribe(data => {
- if (data.type === 'new') return this.unreadNotifications++
- if (data.type === 'read') return this.unreadNotifications--
- if (data.type === 'read-all') return this.unreadNotifications = 0
- })
+ onPopoverHidden () {
+ this.loaded = false
+ }
+
+ onNotificationLoaded () {
+ this.loaded = true
+ }
+
+ onNavigate (link: HTMLAnchorElement) {
+ this.navigate.emit(link)
+ }
+
+ markAllAsRead () {
+ this.markAllAsReadSubject.next(true)
+ }
+
+ private async subscribeToNotifications () {
+ const obs = await this.peertubeSocket.getMyNotificationsSocket()
+
+ this.notificationSub = obs.subscribe(data => {
+ if (data.type === 'new') return this.unreadNotifications++
+ if (data.type === 'read') return this.unreadNotifications--
+ if (data.type === 'read-all') return this.unreadNotifications = 0
+ })