- 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
+ }
+
+ markAllAsRead () {
+ this.markAllAsReadSubject.next(true)
+ }
+
+ private async subscribeToNotifications () {
+ const obs = await this.userNotificationSocket.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
+ })