Skip to content
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
13 changes: 7 additions & 6 deletions browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,15 @@ class NoteList extends React.Component {
}
}

focusNote (selectedNoteKeys, noteKey) {
focusNote (selectedNoteKeys, noteKey, pathname) {
const { router } = this.context
const { location } = this.props

this.setState({
selectedNoteKeys
})

router.push({
pathname: location.pathname,
pathname,
query: {
key: noteKey
}
Expand All @@ -198,6 +197,7 @@ class NoteList extends React.Component {
}
let { selectedNoteKeys } = this.state
const { shiftKeyDown } = this.state
const { location } = this.props

let targetIndex = this.getTargetIndex()

Expand All @@ -214,7 +214,7 @@ class NoteList extends React.Component {
selectedNoteKeys.push(priorNoteKey)
}

this.focusNote(selectedNoteKeys, priorNoteKey)
this.focusNote(selectedNoteKeys, priorNoteKey, location.pathname)

ee.emit('list:moved')
}
Expand All @@ -225,6 +225,7 @@ class NoteList extends React.Component {
}
let { selectedNoteKeys } = this.state
const { shiftKeyDown } = this.state
const { location } = this.props

let targetIndex = this.getTargetIndex()
const isTargetLastNote = targetIndex === this.notes.length - 1
Expand All @@ -247,7 +248,7 @@ class NoteList extends React.Component {
selectedNoteKeys.push(nextNoteKey)
}

this.focusNote(selectedNoteKeys, nextNoteKey)
this.focusNote(selectedNoteKeys, nextNoteKey, location.pathname)

ee.emit('list:moved')
}
Expand All @@ -259,7 +260,7 @@ class NoteList extends React.Component {
}

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

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