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 (isSource && !lastSourceMode) {
|
||||
// Switching TO source: fix blob images first, then extract markdown
|
||||
if (hasPendingBlobs) {
|
||||
hasPendingBlobs = false;
|
||||
fixBlobImages().then(() => {
|
||||
// Switching TO source: extract markdown from editor
|
||||
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
||||
resetSourceHistory(sourceContent);
|
||||
lastSourceMode = true;
|
||||
});
|
||||
} else {
|
||||
sourceContent = editor ? editorToMarkdown() : ($activeNote?.content ?? '');
|
||||
resetSourceHistory(sourceContent);
|
||||
lastSourceMode = true;
|
||||
}
|
||||
} else if (!isSource && lastSourceMode) {
|
||||
lastSourceMode = false;
|
||||
if (isMobile) {
|
||||
@@ -4646,6 +4637,11 @@
|
||||
tick().then(() => {
|
||||
if (editorElement && !editor) {
|
||||
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