mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
fix bugs
This commit is contained in:
@@ -28,9 +28,9 @@ export class PublicationsPage implements OnInit {
|
||||
publicationFolder: PublicationFolder;
|
||||
publication: Publication;
|
||||
|
||||
publicationsEventFolderList: PublicationFolder[];
|
||||
publicationsEventFolderList: PublicationFolder[] = [];
|
||||
actionsListStorage: PublicationFolder[] = new Array();
|
||||
publicationsTravelFolderList: PublicationFolder[];
|
||||
publicationsTravelFolderList: PublicationFolder[] = [];
|
||||
|
||||
theDate: any;
|
||||
theEndDate: any;
|
||||
@@ -91,10 +91,6 @@ export class PublicationsPage implements OnInit {
|
||||
});
|
||||
this.hideRefreshButton();
|
||||
|
||||
/* this.backgroundservice.registerBackService('Online', () => {
|
||||
this.getActions();
|
||||
}) */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -142,55 +138,67 @@ export class PublicationsPage implements OnInit {
|
||||
return this.theDate.getDate() + " de " + (this.months[this.theDate.getMonth()]) + " de " + this.theDate.getFullYear()
|
||||
}
|
||||
|
||||
loadList = false
|
||||
|
||||
getActions() {
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true;
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
|
||||
|
||||
let publicationsEventFolderList = new Array();
|
||||
let publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
if(this.loadList == false) {
|
||||
this.loadList = true
|
||||
this.showLoader = true;
|
||||
this.skeletonLoader = true;
|
||||
this.getFromDB()
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
|
||||
|
||||
|
||||
let publicationsEventFolderList = new Array();
|
||||
let publicationsTravelFolderList = new Array();
|
||||
|
||||
res.forEach(data => {
|
||||
let folder: PublicationFolder = {
|
||||
ProcessId: data.ProcessId,
|
||||
Description: data.Description,
|
||||
Detail: data.Detail,
|
||||
DateBegin: data.DateBegin,
|
||||
DateEnd: data.DateEnd,
|
||||
ActionType: data.ActionType,
|
||||
}
|
||||
|
||||
this.addActionToDB(folder)
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
|
||||
publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
|
||||
publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
await this.storage.set('actionsEvents', publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', publicationsTravelFolderList);
|
||||
this.getFromDB()
|
||||
} else {
|
||||
this.getFromDB()
|
||||
}
|
||||
|
||||
this.addActionToDB(folder)
|
||||
|
||||
if (data.ActionType == "Evento") {
|
||||
|
||||
publicationsEventFolderList.push(folder);
|
||||
}
|
||||
else {
|
||||
|
||||
publicationsTravelFolderList.push(folder);
|
||||
}
|
||||
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
|
||||
}, (error) => {
|
||||
// this.getFromDB();
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false;
|
||||
this.loadList = false
|
||||
});
|
||||
}
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
await this.storage.set('actionsEvents', publicationsEventFolderList);
|
||||
await this.storage.set('actionsViagens', publicationsTravelFolderList);
|
||||
this.getFromDB()
|
||||
} else {
|
||||
this.getFromDB()
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
}/* , (error) => {
|
||||
this.getFromDB();
|
||||
} */);
|
||||
this.skeletonLoader = false;
|
||||
}
|
||||
|
||||
addActionToStorage(events, viagens) {
|
||||
@@ -253,7 +261,7 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
});
|
||||
} else {
|
||||
this.sqliteservice.getAllActions().then((actions: any[]) => {
|
||||
this.sqliteservice.getAllActions().then((actions: any[] = []) => {
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user