mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
add synchro
This commit is contained in:
+19
-38
@@ -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')
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
postMessage("I\'m working before postMessage(\'ali\').");
|
||||
|
||||
onmessage = function(oEvent) {
|
||||
postMessage('Hi ' + oEvent.data);
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
// / <reference lib="webworker" />
|
||||
|
||||
addEventListener('message', ({ data }) => {
|
||||
const response = `worker response to ${data}`;
|
||||
//postMessage(response);
|
||||
});
|
||||
Reference in New Issue
Block a user