mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-04 04:27:42 +03:00
only use keyboard listener in face library when train tab is active
This commit is contained in:
parent
cfe819df77
commit
636d90c442
@ -244,26 +244,29 @@ export default function FaceLibrary() {
|
|||||||
|
|
||||||
// keyboard
|
// keyboard
|
||||||
|
|
||||||
useKeyboardListener(["a", "Escape"], (key, modifiers) => {
|
useKeyboardListener(
|
||||||
if (modifiers.repeat || !modifiers.down) {
|
page === "train" ? ["a", "Escape"] : [],
|
||||||
return;
|
(key, modifiers) => {
|
||||||
}
|
if (modifiers.repeat || !modifiers.down) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "a":
|
case "a":
|
||||||
if (modifiers.ctrl) {
|
if (modifiers.ctrl) {
|
||||||
if (selectedFaces.length) {
|
if (selectedFaces.length) {
|
||||||
setSelectedFaces([]);
|
setSelectedFaces([]);
|
||||||
} else {
|
} else {
|
||||||
setSelectedFaces([...trainImages]);
|
setSelectedFaces([...trainImages]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case "Escape":
|
||||||
case "Escape":
|
setSelectedFaces([]);
|
||||||
setSelectedFaces([]);
|
break;
|
||||||
break;
|
}
|
||||||
}
|
},
|
||||||
});
|
);
|
||||||
|
|
||||||
if (!config) {
|
if (!config) {
|
||||||
return <ActivityIndicator />;
|
return <ActivityIndicator />;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user