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 // Switching TO source: fix blob images first, then extract markdown
if (hasPendingBlobs) { if (hasPendingBlobs) {
hasPendingBlobs = false; hasPendingBlobs = false;
fixingBlobsPromise = fixBlobImages(); fixBlobImages().then(() => {
} sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
const doSwap = () => { resetSourceHistory(sourceContent);
lastSourceMode = true;
});
} else {
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? ''); sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
resetSourceHistory(sourceContent); resetSourceHistory(sourceContent);
lastSourceMode = true; lastSourceMode = true;
};
if (fixingBlobsPromise) {
fixingBlobsPromise.then(doSwap);
} else {
doSwap();
} }
} else if (!isSource && lastSourceMode) { } else if (!isSource && lastSourceMode) {
lastSourceMode = false; lastSourceMode = false;