1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Desktop: Fixes #355: Resets the undo manager when creating new notes (#1495)

This commit is contained in:
Luis Orozco
2019-05-06 15:30:04 -05:00
committed by Laurent Cozic
parent f136f40fdc
commit 5934f2f08e

View File

@@ -501,7 +501,7 @@ class NoteTextComponent extends React.Component {
// 2. It resets the undo manager - fixes https://github.com/laurent22/joplin/issues/355
// Note: calling undoManager.reset() doesn't work
try {
this.editor_.editor.getSession().setValue(note ? note.body : '');
this.editor_.editor.getSession().setValue(note && note.body? note.body : '');
} catch (error) {
if (error.message === "Cannot read property 'match' of undefined") {
// The internals of Ace Editor throws an exception when creating a new note,