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
|
let { selectedNoteKeys } = this.state
|
||||||
const { ctrlKeyDown, shiftKeyDown } = this.state
|
const { ctrlKeyDown, shiftKeyDown } = this.state
|
||||||
let firstShiftSelectedNoteIndex = -1
|
let firstShiftSelectedNoteIndex = -1
|
||||||
|
const hasSelectedNoteKey = selectedNoteKeys.length > 0
|
||||||
|
|
||||||
if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) {
|
if (ctrlKeyDown && selectedNoteKeys.includes(uniqueKey)) {
|
||||||
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
|
const newSelectedNoteKeys = selectedNoteKeys.filter((noteKey) => noteKey !== uniqueKey)
|
||||||
@@ -425,7 +426,7 @@ class NoteList extends React.Component {
|
|||||||
}
|
}
|
||||||
selectedNoteKeys.push(uniqueKey)
|
selectedNoteKeys.push(uniqueKey)
|
||||||
|
|
||||||
if (shiftKeyDown && selectedNoteKeys.length > 0) {
|
if (shiftKeyDown && hasSelectedNoteKey) {
|
||||||
const firstSelectedNoteIndex =
|
const firstSelectedNoteIndex =
|
||||||
Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]),
|
Math.max(this.getNoteIndexByKey(selectedNoteKeys[0]),
|
||||||
this.state.firstShiftSelectedNoteIndex)
|
this.state.firstShiftSelectedNoteIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user