mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
change filter function to find, find will match the first note with requested key
This commit is contained in:
committed by
Junyoung Choi
parent
70e57cf738
commit
91d04b99d1
@@ -269,10 +269,9 @@ class NoteList extends React.Component {
|
||||
const selectedNoteKeys = [noteHash]
|
||||
|
||||
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
|
||||
const noteByHash = data.noteMap.map((note) => note).find(note => { return note.key === noteHash })
|
||||
if (noteByHash !== undefined) {
|
||||
locationToSelect = '/storages/' + noteByHash.storage + '/folders/' + noteByHash.folder
|
||||
}
|
||||
|
||||
this.focusNote(selectedNoteKeys, noteHash, locationToSelect)
|
||||
|
||||
Reference in New Issue
Block a user