merge with branchBug

This commit is contained in:
Eudes Inácio
2021-09-29 17:10:18 +01:00
24 changed files with 1329 additions and 735 deletions
@@ -39,12 +39,10 @@ export class ExpedientePage implements OnInit {
ngOnInit() {
const location = window.location
const pathname = location.pathname + location.search
this.getEventsFromLocalDb();
console.log("segrsgre")
<<<<<<< HEAD
this.LoadList()
@@ -58,6 +56,8 @@ export class ExpedientePage implements OnInit {
}
});
=======
>>>>>>> branchBug
}
async LoadList() {
@@ -74,6 +74,7 @@ export class ExpedientePage implements OnInit {
let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task);
this.sqliteservice.addProcess(task);
});
this.listToPresent = this.taskslist
@@ -136,17 +137,25 @@ export class ExpedientePage implements OnInit {
getEventsFromLocalDb() {
synchro.registerCallback('Online', () => {
this.onlinecheck = true;
})
if (synchro.connected === true) {
const location = window.location
const pathname = location.pathname + location.search
this.LoadList()
synchro.registerCallback('Offline', () => {
this.platform.ready().then(() => {
this.onlinecheck = false;
this.taskslist = new Array();
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.LoadList()
}
}
});
} else {
this.taskslist = new Array();
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
console.log("All expedientes from local,", expediente)
expediente.forEach((element) => {
@@ -168,12 +177,9 @@ export class ExpedientePage implements OnInit {
});
this.listToPresent = this.taskslist
console.log("All expedientes from local,", expediente)
})
console.log('Offlineee')
})
})
}
}
}