fix publication slow to reflect

This commit is contained in:
Peter Maquiran
2026-03-05 10:04:57 +01:00
parent ee61f066e4
commit 3ae36a33cd
4 changed files with 12 additions and 9 deletions
@@ -69,7 +69,7 @@ export class PublicationFileGetByDocumentIdService {
}); });
const start = performance.now(); const start = performance.now();
this.local.insert({ await this.local.insert({
...file, ...file,
documentId: input.documentId!, documentId: input.documentId!,
datePublication: input.datePublication, datePublication: input.datePublication,
@@ -83,8 +83,8 @@ export class PublicationFileGetByDocumentIdService {
for (const localFile of localResult.value) { for (const localFile of localResult.value) {
const found = httpResult.value.data.filter((e) => e.name === localFile.name); const found = httpResult.value.data.filter((e) => e.name === localFile.name);
if (found.length === 0 && localFile.name) { if (found.length === 0 && localFile.name) {
//remove.push(localFile); remove.push(localFile);
//this.local.delete(localFile.id); await this.local.delete(localFile.id);
} }
} }
@@ -112,6 +112,7 @@ export class PublicationFromMvService {
})) }))
publication.ProcessId = this.folderId publication.ProcessId = this.folderId
publication.datePublication = new Date().toISOString()
if(this.form.cancel) { if(this.form.cancel) {
window['upload-header-set-remove'](this.id); window['upload-header-set-remove'](this.id);
@@ -130,6 +131,8 @@ export class PublicationFromMvService {
window['publicationEdit']() window['publicationEdit']()
} }
//this.publicationFolderService.loadPublication(this.form.DocumentId, this.folderId)
window['upload-header-set-remove'](this.id); window['upload-header-set-remove'](this.id);
} catch (error) { } catch (error) {
@@ -163,11 +163,6 @@ export class ViewPublicationsPage implements OnInit {
} }
async loadPublication(publicationId, folderId) {
await this.publicationFolderService.loadPublication(publicationId, folderId)
}
getFromDB() { getFromDB() {
const folderId = this.folderId const folderId = this.folderId
+6 -1
View File
@@ -41,6 +41,7 @@ export class SwiperPage implements OnInit {
this.local.find({documentId: this.documentId}).then(async e => { this.local.find({documentId: this.documentId}).then(async e => {
if(e.isOk() && e.value.length == 0) { if(e.isOk() && e.value.length == 0) {
console.log('===============================================0')
var result = await this.publicationFileGetByDocumentIdService.execute({ var result = await this.publicationFileGetByDocumentIdService.execute({
documentId: this.documentId, documentId: this.documentId,
processId: this.processId, processId: this.processId,
@@ -52,6 +53,7 @@ export class SwiperPage implements OnInit {
this.makeLoad(); this.makeLoad();
} }
} else if(e.isOk()) { } else if(e.isOk()) {
console.log('===============================================1')
this.publicationList = e.value; this.publicationList = e.value;
this.makeLoad(); this.makeLoad();
@@ -64,7 +66,10 @@ export class SwiperPage implements OnInit {
}); });
if(result.isOk()) { 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(); this.makeLoad();
} }
} }