1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

fix navigate methods of note list

This commit is contained in:
Dick Choi
2016-09-01 00:02:09 +09:00
parent aefb84df3b
commit 52efc23984

View File

@@ -78,7 +78,7 @@ class NoteList extends React.Component {
let { location } = this.props let { location } = this.props
let targetIndex = _.findIndex(this.notes, (note) => { let targetIndex = _.findIndex(this.notes, (note) => {
return note.uniqueKey === location.query.key return note.storage + '-' + note.key === location.query.key
}) })
if (targetIndex === 0) { if (targetIndex === 0) {
@@ -90,7 +90,7 @@ class NoteList extends React.Component {
router.push({ router.push({
pathname: location.pathname, pathname: location.pathname,
query: { query: {
key: this.notes[targetIndex].uniqueKey key: this.notes[targetIndex].storage + '-' + this.notes[targetIndex].key
} }
}) })
} }
@@ -103,7 +103,7 @@ class NoteList extends React.Component {
let { location } = this.props let { location } = this.props
let targetIndex = _.findIndex(this.notes, (note) => { let targetIndex = _.findIndex(this.notes, (note) => {
return note.uniqueKey === location.query.key return note.storage + '-' + note.key === location.query.key
}) })
if (targetIndex === this.notes.length - 1) { if (targetIndex === this.notes.length - 1) {
@@ -117,7 +117,7 @@ class NoteList extends React.Component {
router.push({ router.push({
pathname: location.pathname, pathname: location.pathname,
query: { query: {
key: this.notes[targetIndex].uniqueKey key: this.notes[targetIndex].storage + '-' + this.notes[targetIndex].key
} }
}) })
ee.emit('list:moved') ee.emit('list:moved')