Sqlite Bug presenting details on web fixed

This commit is contained in:
Eudes Inácio
2021-10-20 11:48:09 +01:00
parent 6819f413a8
commit de29ff978d
7 changed files with 294 additions and 221 deletions
@@ -19,7 +19,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common'
import { DespachoService } from 'src/app/Rules/despacho.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { Platform } from '@ionic/angular';
import { SqliteService } from 'src/app/services/sqlite.service';
import { BackgroundService } from 'src/app/services/background.service';
@@ -57,7 +57,8 @@ export class DespachoPrPage implements OnInit {
private location: Location,
private despachoService: DespachoService,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService
private backgroundservice: BackgroundService,
private platform: Platform,
) {
this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) {
@@ -123,16 +124,14 @@ export class DespachoPrPage implements OnInit {
console.log(this.task);
console.log('GetTask', res);
this.sqliteservice.updateProcess(res)
this.updateProcessOnDB(res);
let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users)).then(() => {
console.log('internen despacho pr ')
})
this.updateProcessInterveners(users)
this.intervenientes = users.filter(user => {
return user.Type == 'I';
});
@@ -162,6 +161,19 @@ export class DespachoPrPage implements OnInit {
});
}
updateProcessOnDB(res) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqliteservice.updateProcess(res);
}
}
updateProcessInterveners(users) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users))
}
}
getFromDB() {
this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => {