Fix vscode-jupyter#13522. Clear attachment if it does not exit. (#186578)

Fix #184630. Clear attachment if it does not exit.
This commit is contained in:
Peng Lyu 2023-06-28 16:41:01 -07:00 committed by GitHub
parent e133f004ed
commit bce3304e98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -232,7 +232,7 @@ export class AttachmentCleaner implements vscode.CodeActionProvider {
if (cell.index > -1 && !objectEquals(markdownAttachmentsInUse, cell.metadata.attachments)) {
const updateMetadata: { [key: string]: any } = deepClone(cell.metadata);
if (Object.keys(markdownAttachmentsInUse).length === 0) {
updateMetadata.attachments = null;
updateMetadata.attachments = undefined;
} else {
updateMetadata.attachments = markdownAttachmentsInUse;
}