Skip to content

Commit b85bfb4

Browse files
fix: prevent deletion of files before sending emails from grid as quick action
AB#118682
1 parent 510f000 commit b85bfb4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/shared/src/lib/components/templates/components/preview-template-modal/preview-template-modal.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ export class PreviewTemplateModalComponent implements OnInit {
146146
}
147147

148148
ngOnInit(): void {
149-
this.dialogRef.closed.subscribe(() => {
149+
this.dialogRef.closed.subscribe((value: any) => {
150+
if (value && value.preventDeletion) {
151+
return;
152+
}
150153
const attachments =
151154
this.emailService.datasetsForm.get('attachments')?.value;
152155
if (attachments.files?.length) {
@@ -246,7 +249,7 @@ export class PreviewTemplateModalComponent implements OnInit {
246249
payload.datasets[0].navigateSettings = previewData?.navigateSettings;
247250
}
248251
}
249-
this.dialogRef.close();
252+
this.dialogRef.close({ preventDeletion: true });
250253
this.emailService.sendQuickEmail(payload).subscribe(() => {
251254
this.onClose();
252255
this.snackBar.openSnackBar(

0 commit comments

Comments
 (0)