Skip to content

Click a note link will now select the right folder note and not /home #2941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,22 @@ class NoteList extends React.Component {
}

jumpNoteByHashHandler (event, noteHash) {
const { data } = this.props

// first argument event isn't used.
if (this.notes === null || this.notes.length === 0) {
return
}

const selectedNoteKeys = [noteHash]
this.focusNote(selectedNoteKeys, noteHash, '/home')

let locationToSelect = '/home'
const noteByHash = data.noteMap.map((note) => note).find(note => note.key === noteHash)
if (noteByHash !== undefined) {
locationToSelect = '/storages/' + noteByHash.storage + '/folders/' + noteByHash.folder
}

this.focusNote(selectedNoteKeys, noteHash, locationToSelect)

ee.emit('list:moved')
}
Expand Down