mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add web notification popup
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user