mirror of
https://gitlab.com/ArkHost/HelixNotes.git
synced 2026-07-24 07:45:57 +02:00
Fix editor not rendering on every other source mode switch
This commit is contained in:
@@ -4617,19 +4617,10 @@
|
|||||||
if (!loadedPath) return;
|
if (!loadedPath) return;
|
||||||
|
|
||||||
if (isSource && !lastSourceMode) {
|
if (isSource && !lastSourceMode) {
|
||||||
// Switching TO source: fix blob images first, then extract markdown
|
// Switching TO source: extract markdown from editor
|
||||||
if (hasPendingBlobs) {
|
|
||||||
hasPendingBlobs = false;
|
|
||||||
fixBlobImages().then(() => {
|
|
||||||
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
||||||
resetSourceHistory(sourceContent);
|
resetSourceHistory(sourceContent);
|
||||||
lastSourceMode = true;
|
lastSourceMode = true;
|
||||||
});
|
|
||||||
} else {
|
|
||||||
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
|
||||||
resetSourceHistory(sourceContent);
|
|
||||||
lastSourceMode = true;
|
|
||||||
}
|
|
||||||
} else if (!isSource && lastSourceMode) {
|
} else if (!isSource && lastSourceMode) {
|
||||||
lastSourceMode = false;
|
lastSourceMode = false;
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
@@ -4646,6 +4637,11 @@
|
|||||||
tick().then(() => {
|
tick().then(() => {
|
||||||
if (editorElement && !editor) {
|
if (editorElement && !editor) {
|
||||||
createEditor(content);
|
createEditor(content);
|
||||||
|
} else if (!editor) {
|
||||||
|
// editorElement not ready yet — retry next frame
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
if (editorElement && !editor) createEditor(content);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user