Web: Files: Hotkeys: fixed caretIndex
This commit is contained in:
parent
1527b925ed
commit
460abe43d1
@ -472,7 +472,10 @@ class HotkeyStore {
|
||||
|
||||
get caretIndex() {
|
||||
const { filesList, hotkeyCaret, selection } = this.filesStore;
|
||||
const id = selection.length ? selection[0].id : hotkeyCaret?.id;
|
||||
const id =
|
||||
selection.length && selection.length === 1 && !hotkeyCaret
|
||||
? selection[0].id
|
||||
: hotkeyCaret?.id;
|
||||
const caretIndex = filesList.findIndex((f) => f.id === id);
|
||||
|
||||
if (caretIndex !== -1) return caretIndex;
|
||||
@ -522,7 +525,7 @@ class HotkeyStore {
|
||||
}
|
||||
|
||||
get prevFile() {
|
||||
const { filesList, selection, hotkeyCaret } = this.filesStore;
|
||||
const { filesList } = this.filesStore;
|
||||
|
||||
if (this.caretIndex !== -1) {
|
||||
const prevCaretIndex = this.caretIndex - 1;
|
||||
|
Loading…
Reference in New Issue
Block a user