From 738dd2b709a655dac755cef5e17a4ff84bfa7078 Mon Sep 17 00:00:00 2001 From: Florian Glombik Date: Thu, 28 Nov 2024 05:51:00 +0100 Subject: [PATCH] Fix upload overwriting the attachment name on first upload --- src/main/webapp/app/lecture/lecture-attachments.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/app/lecture/lecture-attachments.component.ts b/src/main/webapp/app/lecture/lecture-attachments.component.ts index 9580b2c708a6..c49304e3bee7 100644 --- a/src/main/webapp/app/lecture/lecture-attachments.component.ts +++ b/src/main/webapp/app/lecture/lecture-attachments.component.ts @@ -275,6 +275,7 @@ export class LectureAttachmentsComponent implements OnDestroy { this.attachmentFile.set(file); this.attachmentToBeUpdatedOrCreated()!.link = file.name; + this.attachmentToBeUpdatedOrCreated()!.name = this.form.value.attachmentName ?? undefined; if (!this.attachmentToBeUpdatedOrCreated()!.name) { const derivedFileName = this.determineAttachmentNameBasedOnFileName(file.name); this.attachmentToBeUpdatedOrCreated()!.name = derivedFileName;