mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix agenda layout and publication stop playing video on scroll
This commit is contained in:
@@ -21,12 +21,12 @@ export class PublicationFolderService {
|
||||
publicationPipe = new PublicationPipe()
|
||||
getpublication = [];
|
||||
|
||||
|
||||
|
||||
constructor(
|
||||
private storage: Storage,
|
||||
private publications: PublicationsService,
|
||||
) {}
|
||||
|
||||
|
||||
|
||||
createPublicationList(folderId) {
|
||||
if(!this.publicationList[folderId]) {
|
||||
@@ -38,10 +38,10 @@ export class PublicationFolderService {
|
||||
}
|
||||
|
||||
getFromDB(folderId: any) {
|
||||
|
||||
|
||||
|
||||
|
||||
if(!this.restoreFolder[folderId]) {
|
||||
|
||||
|
||||
this.storage.get(folderId).then((viewPublications) => {
|
||||
this.publicationList[folderId] = viewPublications
|
||||
})
|
||||
@@ -50,7 +50,7 @@ export class PublicationFolderService {
|
||||
this.FolderDetails[folderId] = viewPublications
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
this.restoreFolder[folderId] = true
|
||||
}
|
||||
|
||||
@@ -85,19 +85,19 @@ export class PublicationFolderService {
|
||||
}
|
||||
|
||||
deletePost(folderId: any, DocumentId: any) {
|
||||
|
||||
if(this.publicationList[folderId]) {
|
||||
|
||||
|
||||
if(this.publicationList[folderId]) {
|
||||
|
||||
this.publicationList[folderId] = this.publicationList[folderId].filter( e => e.DocumentId != DocumentId)
|
||||
|
||||
|
||||
this.save(folderId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getPublicationDetail(folderId) {
|
||||
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res => {
|
||||
|
||||
this.publications.GetPresidentialAction(folderId).subscribe(res => {
|
||||
this.FolderDetails[folderId] = res
|
||||
this.storage.set(folderId+"name", res)
|
||||
}, (error) => {
|
||||
@@ -113,7 +113,7 @@ export class PublicationFolderService {
|
||||
|
||||
try {
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
|
||||
this.createPublicationList(folderId)
|
||||
let loadLater = []
|
||||
for (let publicationId of publicationIds) {
|
||||
@@ -129,9 +129,9 @@ export class PublicationFolderService {
|
||||
for( let publicationId of loadLater) {
|
||||
await this.loadPublication(publicationId, folderId)
|
||||
}
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
this.getpublication = this.publicationList[folderId];
|
||||
} catch(error) {
|
||||
@@ -144,15 +144,29 @@ export class PublicationFolderService {
|
||||
async loadPublication(publicationId, folderId) {
|
||||
let Publication = await this.publications.GetPublicationWithArrayOfFilesById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
|
||||
let a: any = Object.assign({},this.publicationList[folderId][findIndex])
|
||||
let b: any = Object.assign({}, publicationDetails)
|
||||
|
||||
a.Files = a.Files.length
|
||||
b.Files = b.Files.length
|
||||
|
||||
if(JSON.stringify(a) != JSON.stringify(b)) {
|
||||
|
||||
// console.log({a, b})
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
} else {
|
||||
// console.log({publicationDetails})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -165,7 +179,7 @@ export class PublicationFolderService {
|
||||
|
||||
async setPublication(publicationId, folderId, publicationDetails: Publication) {
|
||||
|
||||
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
@@ -173,13 +187,13 @@ export class PublicationFolderService {
|
||||
} else {
|
||||
this.publicationList[folderId][findIndex] = publicationDetails
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
async getPublication(publicationId, folderId, publicationDetails: Publication) {
|
||||
|
||||
|
||||
|
||||
const findIndex = this.publicationFindIndex(publicationId, folderId)
|
||||
const found = this.publicationIsPresent(publicationId, folderId)
|
||||
if(!found) {
|
||||
@@ -187,7 +201,7 @@ export class PublicationFolderService {
|
||||
} else {
|
||||
return this.publicationList[folderId][findIndex]
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -198,7 +212,7 @@ export class PublicationFolderService {
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user