Skip to content

Commit

Permalink
Desktop: Fixes #9891: Don't rerender markdown notes when the note pre…
Browse files Browse the repository at this point in the history
…view pane is hidden
  • Loading branch information
personalizedrefrigerator committed Feb 8, 2024
1 parent c546030 commit 7d47938
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,10 @@ function CodeMirror(props: NoteBodyEditorProps, ref: ForwardedRef<NoteBodyEditor
const timeoutId = shim.setTimeout(async () => {
let bodyToRender = props.content;

if (!props.visiblePanes.includes('viewer')) {
return;
}

if (!bodyToRender.trim() && props.visiblePanes.indexOf('viewer') >= 0 && props.visiblePanes.indexOf('editor') < 0) {
// Fixes https://github.com/laurent22/joplin/issues/217
bodyToRender = `<i>${_('This note has no content. Click on "%s" to toggle the editor and edit the note.', _('Layout'))}</i>`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ const CodeMirror = (props: NoteBodyEditorProps, ref: ForwardedRef<NoteBodyEditor
const timeoutId = shim.setTimeout(async () => {
let bodyToRender = props.content;

if (!props.visiblePanes.includes('viewer')) {
return;
}

if (!bodyToRender.trim() && props.visiblePanes.indexOf('viewer') >= 0 && props.visiblePanes.indexOf('editor') < 0) {
// Fixes https://github.com/laurent22/joplin/issues/217
bodyToRender = `<i>${_('This note has no content. Click on "%s" to toggle the editor and edit the note.', _('Layout'))}</i>`;
Expand Down

0 comments on commit 7d47938

Please sign in to comment.