diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 4b11d83f3..f81d448cc 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -301,9 +301,6 @@ export class PublicationsPage implements OnInit { const loader = this.toastService.loading(); try { await this.publications.DeletePresidentialAction(id).toPromise(); - if(window["refreshPublication"]) { - window["refreshPublication"](); - } this.toastService._successMessage() } catch (error) { if(error.status == 0) { diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index fc0b7d51e..3024c0b82 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -314,11 +314,12 @@ export class ViewPublicationsPage implements OnInit { }, }); - modal.onDidDismiss().then((res) => { + modal.onDidDismiss().then(async (res) => { if (res.data == 'Yes') { const loader = this.toastService.loading(); try { - this.publications.DeletePresidentialAction(folderId).toPromise(); + await this.publications.DeletePresidentialAction(folderId).toPromise(); + window["refreshPublication"](); this.httpErrorHandle.httpsSucessMessagge('Eliminar Acção') } catch (error) { this.httpErrorHandle.httpStatusHandle(error) @@ -328,6 +329,8 @@ export class ViewPublicationsPage implements OnInit { } this.close(); this.getActions.emit(); + + } // Do nothing });