fix header

This commit is contained in:
Peter Maquiran
2022-10-05 16:16:31 +01:00
parent 9af0ed4d0d
commit 1e8c5c3720
6 changed files with 59 additions and 70 deletions
+28 -38
View File
@@ -33,6 +33,7 @@ export class HeaderPage implements OnInit {
production = environment.production
environment = environment
isProfileOpen = false
constructor(
private router: Router,
@@ -49,42 +50,24 @@ export class HeaderPage implements OnInit {
this.loggeduser = SessionStore.user;
router.events.subscribe((val) => {
this.showSearch = false;
//this.modalController.dismiss();
this.isProfileOpen = false
});
}
ngOnInit() {
async ngOnInit() {
this.hideSearch();
this.update()
/* this.notificationLengthData();
this.eventrigger.getObservable().subscribe(async (data) => {
if (data.notification === "delete" || "recive") {
await this.notificationLengthData();
}
}) */
this.update();
}
update() {
/* setInterval(() => {
this.notificationLengthData();
}, 5000) */
}
/* UpdateNotificationCount() {
this.notificationsService.registerCallback(
'any',
() => {
setTimeout(()=>{
this.notificationLengthData();
}, 100)
}
)
} */
async notificationLengthData() {
await this.storageservice.get("Notifications").then((value) => {
@@ -189,19 +172,26 @@ export class HeaderPage implements OnInit {
return enterAnimation(baseEl).direction('reverse');
}
const modal = await this.modalController.create({
enterAnimation,
leaveAnimation,
component: ProfilePage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
}
});
await modal.present();
if(this.isProfileOpen == false) {
this.isProfileOpen = true;
const modal = await this.modalController.create({
component: ProfilePage,
cssClass: 'model profile-modal search-submodal',
componentProps: {
}
});
await modal.present();
modal.onDidDismiss().then(() => {
this.isProfileOpen = false;
this.notificationLengthData()
})
}
modal.onDidDismiss().then(() => {
this.notificationLengthData()
})
}