Lot of changes

This commit is contained in:
Eudes Inácio
2021-11-09 17:23:39 +01:00
parent 308e5b36fe
commit bef79d674b
29 changed files with 84 additions and 247 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
<img *ngIf="ThemeService.currentTheme == 'tribunal' " src='assets/images/theme/tribunal/tribunal-constitucional.png' alt='logo'>
</div>
<div class="div-profile cursor-pointer" (click)="openProfile()">
<div *ngIf="this.notificationLength > 0" class="icon-badge">{{this.notificationLength}}</div>
<div *ngIf="this.notificationLength > 0" class="icon-badge">{{notificationLength}}</div>
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="icon" src='assets/images/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'tribunal' " class="icon" src='assets/images/theme/tribunal/icons-profile.svg'></ion-icon>
+13 -20
View File
@@ -27,6 +27,7 @@ export class HeaderPage implements OnInit {
DataArray: Array<object> = [];
notificationLength: 0;
SessionStore = SessionStore
check: boolean;
production = environment.production
@@ -49,31 +50,22 @@ export class HeaderPage implements OnInit {
ngOnInit() {
this.hideSearch();
this.notificationLengthData();
this.eventrigger.getObservable().subscribe((data) => {
this.update()
/* this.notificationLengthData();
this.eventrigger.getObservable().subscribe(async (data) => {
if (data.notification === "delete" || "recive") {
setInterval(()=>
{
this.notificationLengthData();
console.log('SETTIMEOUT')
}, 1000);
//clearInterval(timer)
await this.notificationLengthData();
console.log('Current badge: ', this.notificationLength)
console.log('Deleted notification', data)
console.log('Deleted notification', data.notification)
}
})
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
this.UpdateNotificationCount();
} else {
this.UpdateNotificationCount();
} */
}) */
}
update() {
update() {
setInterval(() => {
this.notificationLengthData();
}, 5000)
}
@@ -94,9 +86,10 @@ export class HeaderPage implements OnInit {
/* var data = JSON.parse(value); */
this.notificationLength = value.length;
console.log('Timer badge count 1', this.notificationLength)
})
console.log('Timer badge count', this.notificationLength)
console.log('Timer badge count2', this.notificationLength)
}
hideSearch() {