add synchro

This commit is contained in:
Peter Maquiran
2021-08-30 10:24:46 +01:00
parent e953831a73
commit 4309d01376
24 changed files with 338 additions and 113 deletions
+19 -38
View File
@@ -6,32 +6,18 @@ import { Component, OnInit, NgZone } from '@angular/core';
import { Event } from '../models/event.model';
import { NotificationsService } from '../services/notifications.service';
import { WebNotificationsService } from '../services/webnotifications.service';
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
import { AlertController, Platform } from '@ionic/angular';
import { Router, ActivatedRoute } from '@angular/router';
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
import { DocumentCounterService } from 'src/app/OtherService/document-counter.service'
import { PermissionService } from '../OtherService/permission.service';
import { TotalDocumentStore } from '../store/total-document.service';
import { connection } from '../services/socket/synchro.service';
import { synchro } from '../services/socket/synchro.service';
import { DespachoService } from '../Rules/despacho.service';
import { ExpedienteGdStore } from '../store/expedientegd-store.service';
import { InativityService } from '../services/inativity.service';
import { SessionStore } from '../store/session.service';
// import * as Sentry from "@sentry/browser";
// import { Integrations } from "@sentry/tracing";
// Sentry.init({
// dsn: "https://b374f7c7e09a49adb04197845ded60e9@o927946.ingest.sentry.io/5877459",
// integrations: [new Integrations.BrowserTracing()],
// // Set tracesSampleRate to 1.0 to capture 100%
// // of transactions for performance monitoring.
// // We recommend adjusting this value in production
// tracesSampleRate: 1.0,
// });
import { StorageService } from '../services/storage.service';
@Component({
selector: 'app-home',
@@ -72,7 +58,7 @@ export class HomePage implements OnInit {
postEvent: any;
folderId: string;
connection = connection
synchro = synchro
constructor(
private zone: NgZone,
@@ -85,7 +71,8 @@ export class HomePage implements OnInit {
public p: PermissionService,
public documentCounterService: DocumentCounterService,
private despachoRule: DespachoService,
private inativityService: InativityService) {
private inativityService: InativityService,
private storageService: StorageService,) {
this.router.events.subscribe((val) => {
document.querySelectorAll('ion-modal').forEach((e: any) => e.remove())
@@ -93,7 +80,7 @@ export class HomePage implements OnInit {
this.updateList()
window['platform'] = platform
window['inactivity/function'] = () => {
if(window.location.pathname != '/inactivity') {
@@ -103,25 +90,18 @@ export class HomePage implements OnInit {
}
}
var myWorker = new Worker(new URL('./nice.worker.js', import.meta.url) );
// if (typeof Worker !== 'undefined') {
// // Create a new
// const worker = new Worker(new URL('./nice.worker.ts', import.meta.url));
// worker.onmessage = ({ data }) => {
// console.log(`page got message: ${data}`);
// };
// worker.postMessage('hello');
// } else {
// // Web workers are not supported in this environment.
// // You should add a fallback so that your program still executes correctly.
// }
myWorker.onmessage = function(oEvent) {
console.log('Worker said : ' + oEvent.data);
}
myWorker.postMessage('ali');
}
refreshing() {
}
refreshing() {}
ngOnInit() {
/* this.network.checkNetworkConnection;
@@ -137,9 +117,6 @@ export class HomePage implements OnInit {
}
}
mobilefirstConnect() {
if(window['WLAuthorizationManager']) {
@@ -178,12 +155,16 @@ export class HomePage implements OnInit {
updateList() {
this.notificationsService.registerCallback(
'despachos',
'any',
() => {
this.despachoRule.getList({updateStore: true})
}
)
synchro.registerCallback('Notification', (DataArray)=> {
alert('nice')
}, 'any')
}
}
+5
View File
@@ -0,0 +1,5 @@
postMessage("I\'m working before postMessage(\'ali\').");
onmessage = function(oEvent) {
postMessage('Hi ' + oEvent.data);
};
-6
View File
@@ -1,6 +0,0 @@
// / <reference lib="webworker" />
addEventListener('message', ({ data }) => {
const response = `worker response to ${data}`;
//postMessage(response);
});