Skip to content

Commit 445104d

Browse files
CSSTUDIO-3192: Fix third edge case
1 parent 9551feb commit 445104d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/log/EntryEditor/Description/Description.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ const Description = ({ form, attachmentsDisabled }) => {
135135
let imageFile = null;
136136
for (let item of items) {
137137
if (item.kind === "file" && item.type.match(/^image/)) {
138-
imageFile = generateUniqueFileName(item.getAsFile());
138+
imageFile = item.getAsFile();
139139
}
140140
}
141141
if (imageFile) {
@@ -154,7 +154,9 @@ const Description = ({ form, attachmentsDisabled }) => {
154154
*/
155155
const addEmbeddedImage = (file, width, height) => {
156156
const id = uuidv4();
157-
appendAttachment(new OlogAttachment({ file, id }));
157+
appendAttachment(
158+
new OlogAttachment({ file: generateUniqueFileName(file), id })
159+
);
158160
const imageMarkup = `![](attachment/${id}){width=${width} height=${height}}`;
159161
let description = getValues("description") || "";
160162
description += imageMarkup;

0 commit comments

Comments
 (0)