mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix
This commit is contained in:
@@ -25,8 +25,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
publicationList: {[key: string]: Publication[] } = {};
|
||||
publicationItem: {[key: string]: PublicationFolder } = {};
|
||||
getpublication = [];
|
||||
error: any;
|
||||
oldpublicationIds = []
|
||||
|
||||
@Input() folderId: any;
|
||||
@Output() addNewPublication = new EventEmitter<any>();
|
||||
@@ -59,6 +59,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.createPublicationList()
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
window['_deletePublication'] = (a, b) => {
|
||||
this._deletePublication(a, b)
|
||||
}
|
||||
|
||||
this.getFromDB();
|
||||
}
|
||||
@@ -121,9 +124,10 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
const folderId = this.folderId
|
||||
|
||||
|
||||
try {
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
this.publicationList[folderId] = []
|
||||
|
||||
this.createPublicationList(folderId)
|
||||
let loadLater = []
|
||||
@@ -144,13 +148,22 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
this.getpublication = this.publicationList[folderId];
|
||||
|
||||
this.oldpublicationIds = publicationIds
|
||||
} catch(error) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
_deletePublication = (folderId, publicationId) => {
|
||||
|
||||
this.publicationList[folderId] = this.publicationList[folderId].filter( e => e.DocumentId != publicationId)
|
||||
|
||||
console.log('this.publicationList[folderId]', this.publicationList[folderId].length)
|
||||
|
||||
}
|
||||
|
||||
publicationIsPresent(publicationId, folderId) {
|
||||
return this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user