mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-07-24 07:45:57 +02:00
Fix pasted images disappearing when switching to source mode (#87)
This commit is contained in:
@@ -4617,10 +4617,21 @@
|
|||||||
if (!loadedPath) return;
|
if (!loadedPath) return;
|
||||||
|
|
||||||
if (isSource && !lastSourceMode) {
|
if (isSource && !lastSourceMode) {
|
||||||
// Switching TO source: extract markdown from editor
|
// Switching TO source: fix blob images first, then extract markdown
|
||||||
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
if (hasPendingBlobs) {
|
||||||
resetSourceHistory(sourceContent);
|
hasPendingBlobs = false;
|
||||||
lastSourceMode = true;
|
fixingBlobsPromise = fixBlobImages();
|
||||||
|
}
|
||||||
|
const doSwap = () => {
|
||||||
|
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
||||||
|
resetSourceHistory(sourceContent);
|
||||||
|
lastSourceMode = true;
|
||||||
|
};
|
||||||
|
if (fixingBlobsPromise) {
|
||||||
|
fixingBlobsPromise.then(doSwap);
|
||||||
|
} else {
|
||||||
|
doSwap();
|
||||||
|
}
|
||||||
} else if (!isSource && lastSourceMode) {
|
} else if (!isSource && lastSourceMode) {
|
||||||
lastSourceMode = false;
|
lastSourceMode = false;
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
|
|||||||
Reference in New Issue
Block a user