add web notification popup

This commit is contained in:
Peter Maquiran
2021-08-31 11:10:40 +01:00
parent 8056981ca1
commit b9b3f5be24
3 changed files with 70 additions and 1 deletions
+7 -1
View File
@@ -18,6 +18,7 @@ import { ExpedienteGdStore } from '../store/expedientegd-store.service';
import { InativityService } from '../services/inativity.service';
import { SessionStore } from '../store/session.service';
import { StorageService } from '../services/storage.service';
import { WebNotificationPopupService } from '../services/notification/web-notification-popup.service';
@Component({
selector: 'app-home',
@@ -72,7 +73,10 @@ export class HomePage implements OnInit {
public documentCounterService: DocumentCounterService,
private despachoRule: DespachoService,
private inativityService: InativityService,
private storageService: StorageService,) {
private storageService: StorageService,
private webNotificationPopupService: WebNotificationPopupService) {
this.webNotificationPopupService.askNotificationPermission()
this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
@@ -176,6 +180,8 @@ export class HomePage implements OnInit {
synchro.registerCallback('Notification', (DataArray)=> {
this.webNotificationPopupService.sendNotification(DataArray.Object)
this.storageService.get('Notifications').then((data)=>{
data.push(DataArray)
this.storageService.store("Notifications", data)