fix publication

This commit is contained in:
Peter Maquiran
2023-02-27 19:52:30 +01:00
parent 75e6a62695
commit d289f377b5
12 changed files with 44 additions and 41 deletions
+19 -23
View File
@@ -83,10 +83,9 @@ export class PublicationsPage implements OnInit {
this.router.events.forEach((event) => {
if (event instanceof NavigationEnd && event.url == pathname) {
this.getActions();
}
});
this.hideRefreshButton();
this.getFromDB()
@@ -141,32 +140,29 @@ export class PublicationsPage implements OnInit {
getActions() {
if(this.showLoader == false) {
this.showLoader = false
this.publications.GetPublicationFolderList().subscribe(async res => {
this.showLoader = true;
this.publications.GetPublicationFolderList().subscribe(async res => {
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
} else {
folders.forEach((folder)=> {
this.addActionToDB(folder);
})
}
this.showLoader = false;
}, (error) => {
this.showLoader = false;
});
}
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
await this.storage.set('actionsEvents', this.publicationsEventFolderList);
await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
} else {
folders.forEach((folder)=> {
this.addActionToDB(folder);
})
}
this.showLoader = false;
}, (error) => {
this.showLoader = false;
});
}