Fix pasted images disappearing when switching to source mode (#87)

This commit is contained in:
Yuri Karamian
2026-06-19 11:31:49 +02:00
parent c1a9871703
commit 4f324ad682
+6 -8
View File
@@ -4620,17 +4620,15 @@
// Switching TO source: fix blob images first, then extract markdown
if (hasPendingBlobs) {
hasPendingBlobs = false;
fixingBlobsPromise = fixBlobImages();
}
const doSwap = () => {
fixBlobImages().then(() => {
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
resetSourceHistory(sourceContent);
lastSourceMode = true;
});
} else {
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
resetSourceHistory(sourceContent);
lastSourceMode = true;
};
if (fixingBlobsPromise) {
fixingBlobsPromise.then(doSwap);
} else {
doSwap();
}
} else if (!isSource && lastSourceMode) {
lastSourceMode = false;