@@ -173,16 +173,15 @@ class NoteList extends React.Component {
173
173
}
174
174
}
175
175
176
- focusNote ( selectedNoteKeys , noteKey ) {
176
+ focusNote ( selectedNoteKeys , noteKey , pathname ) {
177
177
const { router } = this . context
178
- const { location } = this . props
179
178
180
179
this . setState ( {
181
180
selectedNoteKeys
182
181
} )
183
182
184
183
router . push ( {
185
- pathname : location . pathname ,
184
+ pathname,
186
185
query : {
187
186
key : noteKey
188
187
}
@@ -201,6 +200,7 @@ class NoteList extends React.Component {
201
200
}
202
201
let { selectedNoteKeys } = this . state
203
202
const { shiftKeyDown } = this . state
203
+ const { location } = this . props
204
204
205
205
let targetIndex = this . getTargetIndex ( )
206
206
@@ -217,7 +217,7 @@ class NoteList extends React.Component {
217
217
selectedNoteKeys . push ( priorNoteKey )
218
218
}
219
219
220
- this . focusNote ( selectedNoteKeys , priorNoteKey )
220
+ this . focusNote ( selectedNoteKeys , priorNoteKey , location . pathname )
221
221
222
222
ee . emit ( 'list:moved' )
223
223
}
@@ -228,6 +228,7 @@ class NoteList extends React.Component {
228
228
}
229
229
let { selectedNoteKeys } = this . state
230
230
const { shiftKeyDown } = this . state
231
+ const { location } = this . props
231
232
232
233
let targetIndex = this . getTargetIndex ( )
233
234
const isTargetLastNote = targetIndex === this . notes . length - 1
@@ -250,7 +251,7 @@ class NoteList extends React.Component {
250
251
selectedNoteKeys . push ( nextNoteKey )
251
252
}
252
253
253
- this . focusNote ( selectedNoteKeys , nextNoteKey )
254
+ this . focusNote ( selectedNoteKeys , nextNoteKey , location . pathname )
254
255
255
256
ee . emit ( 'list:moved' )
256
257
}
@@ -262,7 +263,7 @@ class NoteList extends React.Component {
262
263
}
263
264
264
265
const selectedNoteKeys = [ noteHash ]
265
- this . focusNote ( selectedNoteKeys , noteHash )
266
+ this . focusNote ( selectedNoteKeys , noteHash , '/home' )
266
267
267
268
ee . emit ( 'list:moved' )
268
269
}
0 commit comments