Commit 6e8e3c72 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18927 TIME 0:20 check signed response if resource is draft/not-send

parent f810c350
...@@ -993,10 +993,8 @@ export class MailEditorComponent implements OnInit, OnDestroy { ...@@ -993,10 +993,8 @@ export class MailEditorComponent implements OnInit, OnDestroy {
async openEmailAttach(type: string, attach: any): Promise<void> { async openEmailAttach(type: string, attach: any): Promise<void> {
this.signedAttachId = null; this.signedAttachId = null;
if (type === 'attachments') { if (type === 'attachments') {
if (attach.status === 'SIGN') { this.signedAttachId = attach.id;
this.signedAttachId = attach.id; await this.getSignedAttachment(this.signedAttachId);
await this.getSignedAttachment(this.signedAttachId);
}
this.http.get(`../rest/attachments/${this.signedAttachId !== null ? this.signedAttachId : attach.id}/content?mode=base64`).pipe( this.http.get(`../rest/attachments/${this.signedAttachId !== null ? this.signedAttachId : attach.id}/content?mode=base64`).pipe(
tap((data: any) => { tap((data: any) => {
this.dialog.open(DocumentViewerModalComponent, { autoFocus: false, panelClass: 'maarch-full-height-modal', data: { title: `${attach.label}`, base64: data.encodedDocument, filename: data.filename } }); this.dialog.open(DocumentViewerModalComponent, { autoFocus: false, panelClass: 'maarch-full-height-modal', data: { title: `${attach.label}`, base64: data.encodedDocument, filename: data.filename } });
...@@ -1043,7 +1041,11 @@ export class MailEditorComponent implements OnInit, OnDestroy { ...@@ -1043,7 +1041,11 @@ export class MailEditorComponent implements OnInit, OnDestroy {
return new Promise((resolve) => { return new Promise((resolve) => {
this.http.get(`../rest/attachments/${id}`).pipe( this.http.get(`../rest/attachments/${id}`).pipe(
tap((data: any) => { tap((data: any) => {
this.signedAttachId = data.signedResponse; if (!this.functions.empty(data.signedResponse)) {
this.signedAttachId = data.signedResponse;
} else {
this.signedAttachId = null;
}
resolve(true); resolve(true);
}), }),
catchError((err: any) => { catchError((err: any) => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment