mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
jumpNoteByHashHandler will now try to find the location for the note that will be selected
This commit is contained in:
committed by
Junyoung Choi
parent
2f00cec52b
commit
70e57cf738
@@ -259,13 +259,23 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jumpNoteByHashHandler (event, noteHash) {
|
jumpNoteByHashHandler (event, noteHash) {
|
||||||
|
const { data } = this.props
|
||||||
|
|
||||||
// first argument event isn't used.
|
// first argument event isn't used.
|
||||||
if (this.notes === null || this.notes.length === 0) {
|
if (this.notes === null || this.notes.length === 0) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedNoteKeys = [noteHash]
|
const selectedNoteKeys = [noteHash]
|
||||||
this.focusNote(selectedNoteKeys, noteHash, '/home')
|
|
||||||
|
let locationToSelect = '/home'
|
||||||
|
const notesByHash = data.noteMap.map((note) => note).filter((note) => note.key === noteHash)
|
||||||
|
if (notesByHash.length > 0) {
|
||||||
|
const note = notesByHash[0]
|
||||||
|
locationToSelect = '/storages/' + note.storage + '/folders/' + note.folder
|
||||||
|
}
|
||||||
|
|
||||||
|
this.focusNote(selectedNoteKeys, noteHash, locationToSelect)
|
||||||
|
|
||||||
ee.emit('list:moved')
|
ee.emit('list:moved')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user