mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Web notifications added
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { AnimationController, ModalController,Platform } from '@ionic/angular';
|
||||
import { AnimationController, ModalController, Platform } from '@ionic/angular';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { Router } from '@angular/router';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
@@ -28,7 +28,7 @@ export class HeaderPage implements OnInit {
|
||||
SessionStore = SessionStore
|
||||
|
||||
production = environment.production
|
||||
|
||||
|
||||
constructor(
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
@@ -50,39 +50,39 @@ export class HeaderPage implements OnInit {
|
||||
this.hideSearch();
|
||||
this.notificationLengthData();
|
||||
|
||||
/* 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 )
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
this.UpdateNotificationCount();
|
||||
} else {
|
||||
this.UpdateNotificationCount();
|
||||
} */
|
||||
}
|
||||
|
||||
/* UpdateNotificationCount() {
|
||||
this.notificationsService.registerCallback(
|
||||
'any',
|
||||
() => {
|
||||
setTimeout(()=>{
|
||||
this.notificationLengthData();
|
||||
}, 100)
|
||||
}
|
||||
)
|
||||
} */
|
||||
|
||||
notificationLengthData() {
|
||||
ionViewWillEnter() {
|
||||
this.eventrigger.getObservable().subscribe((data) => {
|
||||
if (data.notification == "delete" || "recive") {
|
||||
this.notificationLengthData();
|
||||
console.log('Deleted notification', data)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* UpdateNotificationCount() {
|
||||
this.notificationsService.registerCallback(
|
||||
'any',
|
||||
() => {
|
||||
setTimeout(()=>{
|
||||
this.notificationLengthData();
|
||||
}, 100)
|
||||
}
|
||||
)
|
||||
} */
|
||||
|
||||
notificationLengthData() {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
console.log("Init get store", value)
|
||||
|
||||
/* var data = JSON.parse(value); */
|
||||
/* var data = JSON.parse(value); */
|
||||
this.notificationLength = value.length;
|
||||
})
|
||||
|
||||
@@ -173,10 +173,10 @@ export class HeaderPage implements OnInit {
|
||||
});
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then(()=>{
|
||||
modal.onDidDismiss().then(() => {
|
||||
this.notificationLengthData()
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
async dynamicSearch() {
|
||||
|
||||
Reference in New Issue
Block a user