This commit is contained in:
tiago.kayaya
2021-08-31 11:29:37 +01:00
17 changed files with 297 additions and 85 deletions
+1 -1
View File
@@ -82,7 +82,7 @@
<div class="profile-text">
<ion-label>{{profileLabel(loggeduser.Profile)}}</ion-label>
<div *ngIf="this.notificationLength > 0 && !production" class="icon-badge" style="right: -18px;top: -9px;" >{{this.notificationLength}}</div>
<div *ngIf="this.notificationLength > 0 && !production" class="icon-badge" style="right: -18px;top: -9px;" >{{notificationLength}}</div>
</div>
</div>
+13 -3
View File
@@ -44,19 +44,24 @@ export class HeaderPage implements OnInit {
ngOnInit() {
this.hideSearch();
this.notificationLengthData();
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
this.UpdateNotificationCount();
} else {
this.UpdateNotificationCount();
}
}
UpdateNotificationCount() {
this.notificationsService.registerCallback(
'any',
() => {
this.notificationLengthData();
setTimeout(()=>{
this.notificationLengthData();
}, 100)
}
)
}
@@ -65,6 +70,8 @@ export class HeaderPage implements OnInit {
this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
if(value == 'žée') return false
/* var data = JSON.parse(value); */
this.notificationLength = value.length;
})
@@ -146,7 +153,6 @@ export class HeaderPage implements OnInit {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
@@ -156,6 +162,10 @@ export class HeaderPage implements OnInit {
}
});
await modal.present();
modal.onDidDismiss().then(()=>{
this.notificationLengthData()
})
}