eventtrigger created for notifications

This commit is contained in:
Eudes Inácio
2021-09-21 06:08:01 +01:00
parent 3c78c5ddc4
commit 7fdb16c272
4 changed files with 56 additions and 3 deletions
+13 -3
View File
@@ -8,6 +8,7 @@ import { StorageService } from '../../services/storage.service';
import { SessionStore } from 'src/app/store/session.service';
import { NotificationsService } from '../../services/notifications.service';
import { environment } from 'src/environments/environment';
import { EventTrigger } from '../../services/eventTrigger.service';
@Component({
selector: 'app-header',
@@ -33,7 +34,8 @@ export class HeaderPage implements OnInit {
private animationController: AnimationController,
private storageservice: StorageService,
private platform: Platform,
private notificationsService: NotificationsService,
private notificationsService: NotificationsService,
private eventrigger: EventTrigger
) {
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
@@ -46,12 +48,20 @@ export class HeaderPage implements OnInit {
this.hideSearch();
this.notificationLengthData();
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
this.UpdateNotificationCount();
} else {
this.UpdateNotificationCount();
}
} */
this.eventrigger.getObservable().subscribe((data)=>{
if(data.notification == "delete" || "recive"){
this.notificationLengthData();
console.log('Deleted notification',data )
}
})
}