Skip to content

Commit 834ad73

Browse files
author
Michael Lively
committed
small fix in logic
1 parent 47e556e commit 834ad73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

extensions/ipynb/src/notebookImagePaste.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ function buildAttachment(b64: string, cell: vscode.NotebookCell, filename: strin
135135
const objEntries = Object.entries(startingAttachments[tempFilename]);
136136
if (objEntries.length) { // check that mime:b64 are present
137137
const [, attachmentb64] = objEntries[0];
138-
if (attachmentb64 !== b64) { // append a "-#" here. same name, diff data. this matches jupyter behavior
138+
if (attachmentb64 === b64) { // checking if filename can be reused, based on camparison of image data
139+
break;
140+
} else {
139141
tempFilename = filename.concat(`-${appendValue}`) + filetype;
140142
}
141143
}

0 commit comments

Comments
 (0)