mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Updated the condition with more appropriate naming
This commit is contained in:
@@ -412,6 +412,7 @@ class NoteList extends React.Component {
|
||||
let { selectedNoteKeys } = this.state
|
||||
const { ctrlKeyDown, shiftKeyDown } = this.state
|
||||
let firstShiftSelectedNoteIndex = -1
|
||||
const hasSelectedNoteKey = selectedNoteKeys.length > 0
|
||||
|
||||
if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) {
|
||||
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
|
||||
@@ -425,7 +426,7 @@ class NoteList extends React.Component {
|
||||
}
|
||||
selectedNoteKeys.push(uniqueKey)
|
||||
|
||||
if (shiftKeyDown && selectedNoteKeys.length > 0) {
|
||||
if (shiftKeyDown && hasSelectedNoteKey) {
|
||||
const firstSelectedNoteIndex =
|
||||
Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]),
|
||||
this.state.firstShiftSelectedNoteIndex)
|
||||
|
||||
Reference in New Issue
Block a user