diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts
index 2546cc305..8ce820f8e 100644
--- a/src/app/pages/publications/publications.page.ts
+++ b/src/app/pages/publications/publications.page.ts
@@ -89,7 +89,6 @@ export class PublicationsPage implements OnInit {
});
this.hideRefreshButton();
-
}
@@ -148,40 +147,22 @@ export class PublicationsPage implements OnInit {
this.showLoader = false;
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
- // let publications = await ActionModel.create(folders)
- // console.log('publications', publications)
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);
- })
- }
+ await this.storage.set('actionsEvents', this.publicationsEventFolderList);
+ await this.storage.set('actionsViagens', this.publicationsTravelFolderList);
this.showLoader = false;
}, (error) => {
this.showLoader = false;
this.getFromDB()
-
});
}
- // addActionToStorage(events, viagens) {
-
- // if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
- // this.storage.set('actionsEvents', events);
- // this.storage.set('actionsViagens', viagens);
- // }
- // }
-
-
addActionToDB(folder) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
@@ -204,39 +185,26 @@ export class PublicationsPage implements OnInit {
}
getFromDB() {
-
- if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
- this.storage.get('actionsEvents').then((events = []) => {
+ this.storage.get('actionsEvents').then((events = []) => {
- if(Array.isArray(events)) {
- const folders: PublicationFolder[] = this.getPublicationFolderMap(events)
+ if(Array.isArray(events)) {
+ const folders: PublicationFolder[] = this.getPublicationFolderMap(events)
- this.showLoader = false;
- this.publicationsEventFolderList = folders
- }
-
- });
- this.storage.get('actionsViagens').then((viagens = []) => {
-
- if(Array.isArray(viagens)) {
- const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens)
-
- this.publicationsTravelFolderList = folders
- this.showLoader = false;
- }
-
- });
- } else {
- this.sqliteservice.getAllActions().then((actions: any[] = []) => {
-
- const folders: PublicationFolder[] = this.getPublicationFolderMap(actions)
-
- this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
- this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
this.showLoader = false;
+ this.publicationsEventFolderList = folders
+ }
- })
- }
+ });
+ this.storage.get('actionsViagens').then((viagens = []) => {
+
+ if(Array.isArray(viagens)) {
+ const folders: PublicationFolder[] = this.getPublicationFolderMap(viagens)
+
+ this.publicationsTravelFolderList = folders
+ this.showLoader = false;
+ }
+
+ });
}
async editAction(folderId?: string) {
diff --git a/src/app/pages/publications/view-publications/view-publications.page.html b/src/app/pages/publications/view-publications/view-publications.page.html
index eab5ca99e..623bb0ea2 100644
--- a/src/app/pages/publications/view-publications/view-publications.page.html
+++ b/src/app/pages/publications/view-publications/view-publications.page.html
@@ -7,10 +7,10 @@
{{publicationItem[folderId].Detail}}
-{{publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}
+{{publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}
{{publicationItem[folderId].Detail}}
-{{ publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}
+{{ publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}