mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Improve
This commit is contained in:
@@ -69,7 +69,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublicationDetail();
|
||||
setTimeout(() => {
|
||||
this.getPublications();
|
||||
}, 5000);
|
||||
}, 1000);
|
||||
|
||||
this.backgroundservice.registerBackService('Online',() => {
|
||||
this.getPublicationDetail();
|
||||
@@ -110,23 +110,28 @@ export class ViewPublicationsPage implements OnInit {
|
||||
getPublicationDetail() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list)
|
||||
this.item = allActions.find((e) => e.ProcessId == this.folderId);
|
||||
this.publicationDitails = this.item
|
||||
console.log('item', this.item)
|
||||
|
||||
}, 100);
|
||||
|
||||
}
|
||||
|
||||
getPublications() {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
alert('get 2')
|
||||
this.publications.GetPublications(this.folderId).subscribe(res => {
|
||||
alert('get 2 resppose')
|
||||
console.log(this.folderId)
|
||||
|
||||
this.publicationList = new Array();
|
||||
|
||||
|
||||
res.forEach(element => {
|
||||
console.log('getPublications', element)
|
||||
let item: Publication = this.publicationPipe.itemList(element)
|
||||
@@ -134,26 +139,23 @@ export class ViewPublicationsPage implements OnInit {
|
||||
});
|
||||
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
|
||||
|
||||
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
this.getpublication = this.publicationList;
|
||||
|
||||
this.showLoader = false;
|
||||
},
|
||||
(error) => {
|
||||
if(error.status == '0') {
|
||||
this.getFromDB();
|
||||
}
|
||||
if (error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList = [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
});
|
||||
}, (error) => {
|
||||
|
||||
alert('error')
|
||||
if(error.status == '0') {
|
||||
this.getFromDB();
|
||||
}
|
||||
if (error.status == '404') {
|
||||
this.error = 'Sem publicações disponíveis!';
|
||||
this.publicationList = [];
|
||||
this.publicationListStorage.add(folderId, this.publicationList)
|
||||
}
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
|
||||
Reference in New Issue
Block a user