From 834ad7365b970851f1ad1b12fdd5641cd41572ff Mon Sep 17 00:00:00 2001 From: Michael Lively Date: Wed, 31 Aug 2022 15:41:15 -0700 Subject: [PATCH] small fix in logic --- extensions/ipynb/src/notebookImagePaste.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/ipynb/src/notebookImagePaste.ts b/extensions/ipynb/src/notebookImagePaste.ts index 05b7eb241d1..bf2c8b4467e 100644 --- a/extensions/ipynb/src/notebookImagePaste.ts +++ b/extensions/ipynb/src/notebookImagePaste.ts @@ -135,7 +135,9 @@ function buildAttachment(b64: string, cell: vscode.NotebookCell, filename: strin const objEntries = Object.entries(startingAttachments[tempFilename]); if (objEntries.length) { // check that mime:b64 are present const [, attachmentb64] = objEntries[0]; - if (attachmentb64 !== b64) { // append a "-#" here. same name, diff data. this matches jupyter behavior + if (attachmentb64 === b64) { // checking if filename can be reused, based on camparison of image data + break; + } else { tempFilename = filename.concat(`-${appendValue}`) + filetype; } }