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
@@ -12,7 +12,7 @@ import { DeplomaOptionsPage } from 'src/app/shared/popover/deploma-options/deplo
import { ToastService } from 'src/app/services/toast.service';
import { Location } from '@angular/common';
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';
@@ -47,7 +47,8 @@ export class DiplomaPage implements OnInit {
private toastService: ToastService,
private location: Location,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService
private backgroundservice: BackgroundService,
private platform: Platform,
) {
this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]);
@@ -134,15 +135,13 @@ export class DiplomaPage implements OnInit {
"activityInstanceName": res.activityInstanceName,
}
this.fulltask = 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 diploma ')
})
this.updateProcessInterveners(users)
this.intervenientes = users.filter(user => {
return user.Type == 'I';
});
@@ -167,6 +166,19 @@ export class DiplomaPage 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) => {