mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
improve publication
This commit is contained in:
@@ -59,6 +59,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
this.getPublicationDetail();
|
||||
|
||||
this.getFromDB();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: any): void {
|
||||
@@ -67,7 +69,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
|
||||
this.getFromDB();
|
||||
//setTimeout(()=>{
|
||||
this.getPublicationDetail();
|
||||
this.getPublicationsIds();
|
||||
@@ -119,8 +121,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
this.storage.remove('view_publications');
|
||||
this.storage.set('view_publications', this.publicationList);
|
||||
this.storage.remove(folderId);
|
||||
this.storage.set(this.folderId, this.publicationList);
|
||||
|
||||
|
||||
this.getpublication = this.publicationList;
|
||||
@@ -132,39 +134,39 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
this.storage.get('view_publications').then((viewPublications) => {
|
||||
this.storage.get(this.folderId).then((viewPublications) => {
|
||||
this.publicationList = viewPublications;
|
||||
})
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
this.publicationList = new Array();
|
||||
//this.getFromDB();
|
||||
this.publications.GetPublications(folderId).subscribe(async res=> {
|
||||
// getPublications() {
|
||||
// this.showLoader = true;
|
||||
// const folderId = this.folderId
|
||||
// this.publicationList = new Array();
|
||||
// this.publications.GetPublications(folderId).subscribe(async res=> {
|
||||
|
||||
res.forEach(element => {
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
this.publicationList.push(item);
|
||||
});
|
||||
// res.forEach(element => {
|
||||
// let item: Publication = this.publicationPipe.itemList(element)
|
||||
// this.publicationList.push(item);
|
||||
// });
|
||||
|
||||
await this.storage.remove('view_publications');
|
||||
await this.storage.set('view_publications', this.publicationList);
|
||||
//this.getFromDB();
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error)=>{
|
||||
if(error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList= [];
|
||||
}
|
||||
// this.showLoader = false;
|
||||
// await this.storage.remove(folderId);
|
||||
// await this.storage.set(folderId, this.publicationList);
|
||||
// //this.getFromDB();
|
||||
|
||||
// },
|
||||
// (error)=>{
|
||||
// if(error.status == '404') {
|
||||
// this.error = 'Sem publicações disponíveis!';
|
||||
// this.publicationList= [];
|
||||
// }
|
||||
|
||||
this.showLoader = false;
|
||||
// this.showLoader = false;
|
||||
|
||||
})
|
||||
// })
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
async AddPublication(publicationType:any, folderId:any) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user