Skip to content

Commit ad7b155

Browse files
committed
Updated the condition with more appropriate naming
1 parent 3df743f commit ad7b155

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

browser/main/NoteList/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ class NoteList extends React.Component {
412412
let { selectedNoteKeys } = this.state
413413
const { ctrlKeyDown, shiftKeyDown } = this.state
414414
let firstShiftSelectedNoteIndex = -1
415+
const hasSelectedNoteKey = selectedNoteKeys.length > 0
415416

416417
if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) {
417418
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
@@ -425,7 +426,7 @@ class NoteList extends React.Component {
425426
}
426427
selectedNoteKeys.push(uniqueKey)
427428

428-
if (shiftKeyDown && selectedNoteKeys.length > 0) {
429+
if (shiftKeyDown && hasSelectedNoteKey) {
429430
const firstSelectedNoteIndex =
430431
Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]),
431432
this.state.firstShiftSelectedNoteIndex)

0 commit comments

Comments
 (0)