mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
fix publication slow to reflect
This commit is contained in:
@@ -69,7 +69,7 @@ export class PublicationFileGetByDocumentIdService {
|
||||
});
|
||||
|
||||
const start = performance.now();
|
||||
this.local.insert({
|
||||
await this.local.insert({
|
||||
...file,
|
||||
documentId: input.documentId!,
|
||||
datePublication: input.datePublication,
|
||||
@@ -83,8 +83,8 @@ export class PublicationFileGetByDocumentIdService {
|
||||
for (const localFile of localResult.value) {
|
||||
const found = httpResult.value.data.filter((e) => e.name === localFile.name);
|
||||
if (found.length === 0 && localFile.name) {
|
||||
//remove.push(localFile);
|
||||
//this.local.delete(localFile.id);
|
||||
remove.push(localFile);
|
||||
await this.local.delete(localFile.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -112,6 +112,7 @@ export class PublicationFromMvService {
|
||||
}))
|
||||
|
||||
publication.ProcessId = this.folderId
|
||||
publication.datePublication = new Date().toISOString()
|
||||
|
||||
if(this.form.cancel) {
|
||||
window['upload-header-set-remove'](this.id);
|
||||
@@ -130,6 +131,8 @@ export class PublicationFromMvService {
|
||||
window['publicationEdit']()
|
||||
}
|
||||
|
||||
//this.publicationFolderService.loadPublication(this.form.DocumentId, this.folderId)
|
||||
|
||||
window['upload-header-set-remove'](this.id);
|
||||
|
||||
} catch (error) {
|
||||
|
||||
@@ -163,11 +163,6 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
async loadPublication(publicationId, folderId) {
|
||||
|
||||
await this.publicationFolderService.loadPublication(publicationId, folderId)
|
||||
|
||||
}
|
||||
|
||||
getFromDB() {
|
||||
const folderId = this.folderId
|
||||
|
||||
@@ -41,6 +41,7 @@ export class SwiperPage implements OnInit {
|
||||
|
||||
this.local.find({documentId: this.documentId}).then(async e => {
|
||||
if(e.isOk() && e.value.length == 0) {
|
||||
console.log('===============================================0')
|
||||
var result = await this.publicationFileGetByDocumentIdService.execute({
|
||||
documentId: this.documentId,
|
||||
processId: this.processId,
|
||||
@@ -52,6 +53,7 @@ export class SwiperPage implements OnInit {
|
||||
this.makeLoad();
|
||||
}
|
||||
} else if(e.isOk()) {
|
||||
console.log('===============================================1')
|
||||
this.publicationList = e.value;
|
||||
this.makeLoad();
|
||||
|
||||
@@ -64,7 +66,10 @@ export class SwiperPage implements OnInit {
|
||||
});
|
||||
|
||||
if(result.isOk()) {
|
||||
this.publicationList = result.value.added;
|
||||
var newList = await this.local.find({documentId: this.documentId})
|
||||
if(newList.isOk()) {
|
||||
this.publicationList = newList.value;
|
||||
}
|
||||
this.makeLoad();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user