Gabinete digital offline complete

This commit is contained in:
Eudes Inácio
2021-09-29 16:47:58 +01:00
parent b59070f35e
commit 0b42dba6ca
25 changed files with 1324 additions and 746 deletions
@@ -79,7 +79,7 @@ export class ApproveEventPage implements OnInit {
console.log(this.serialNumber);
console.log(this.caller);
this.getProcessFromDB();
this.getTask();
}
goBack() {
@@ -105,6 +105,10 @@ export class ApproveEventPage implements OnInit {
getProcessFromDB() {
if (synchro.connected === true) {
this.getTask();
}
synchro.registerCallback('Offline', () => {
this.platform.ready().then(() => {
@@ -46,27 +46,10 @@ export class EventListPage implements OnInit {
) { }
ngOnInit() {
this.segment = 'MDGPR';
const location = window.location
const pathname = location.pathname + location.search
this.getEventToAproveFromDB();
this.LoadToApproveEvents()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
this.LoadToApproveEvents()
}
}
});
window.onresize = (event) => {
// if not mobile remove all component
if( window.innerWidth <= 800){
@@ -78,6 +61,23 @@ export class EventListPage implements OnInit {
getEventToAproveFromDB() {
if( synchro.connected === true) {
const location = window.location
const pathname = location.pathname + location.search
this.LoadToApproveEvents()
this.router.events.forEach((event) => {
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
this.refreshing()
} else {
this.LoadToApproveEvents()
}
}
});
}
synchro.registerCallback('Offline', () => {
this.platform.ready().then(() => {