mirror of https://github.com/laurent22/joplin.git
Electron: Fixes #217: Display a message when the note has no content and only the note viewer is visible
parent
4dda397c29
commit
3691ae4d13
|
@ -600,7 +600,14 @@ class NoteTextComponent extends React.Component {
|
||||||
},
|
},
|
||||||
postMessageSyntax: 'ipcRenderer.sendToHost',
|
postMessageSyntax: 'ipcRenderer.sendToHost',
|
||||||
};
|
};
|
||||||
const html = this.mdToHtml().render(body, theme, mdOptions);
|
|
||||||
|
let bodyToRender = body;
|
||||||
|
if (!bodyToRender.trim() && visiblePanes.indexOf('viewer') >= 0 && visiblePanes.indexOf('editor') < 0) {
|
||||||
|
// Fixes https://github.com/laurent22/joplin/issues/217
|
||||||
|
bodyToRender = '*' + _('This not has no content. Click on "%s" to toggle the editor and edit the note.', _('Layout')) + '*';
|
||||||
|
}
|
||||||
|
|
||||||
|
const html = this.mdToHtml().render(bodyToRender, theme, mdOptions);
|
||||||
this.webview_.send('setHtml', html);
|
this.webview_.send('setHtml', html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue