From 5e07c7b3e1573cecabb917c10675cc0952b66bce Mon Sep 17 00:00:00 2001 From: Sander Steenhuis Date: Mon, 12 Feb 2018 18:15:05 +0100 Subject: [PATCH] Update selection on new note; closes #1507 --- browser/main/modals/NewNoteModal.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js index 24b150cb5..8322d99f3 100644 --- a/browser/main/modals/NewNoteModal.js +++ b/browser/main/modals/NewNoteModal.js @@ -35,14 +35,16 @@ class NewNoteModal extends React.Component { content: '' }) .then((note) => { + const noteHash = `${note.storage}-${note.key}` dispatch({ type: 'UPDATE_NOTE', note: note }) hashHistory.push({ pathname: location.pathname, - query: {key: note.storage + '-' + note.key} + query: {key: noteHash} }) + ee.emit('list:jump', noteHash) ee.emit('detail:focus') this.props.close() }) @@ -73,14 +75,16 @@ class NewNoteModal extends React.Component { }] }) .then((note) => { + const noteHash = `${note.storage}-${note.key}` dispatch({ type: 'UPDATE_NOTE', note: note }) hashHistory.push({ pathname: location.pathname, - query: {key: note.storage + '-' + note.key} + query: {key: noteHash} }) + ee.emit('list:jump', noteHash) ee.emit('detail:focus') this.props.close() })