only use keyboard listener in face library when train tab is active

This commit is contained in:
Josh Hawkins 2025-05-07 15:57:12 -05:00
parent cfe819df77
commit 636d90c442

View File

@ -244,7 +244,9 @@ export default function FaceLibrary() {
// keyboard
useKeyboardListener(["a", "Escape"], (key, modifiers) => {
useKeyboardListener(
page === "train" ? ["a", "Escape"] : [],
(key, modifiers) => {
if (modifiers.repeat || !modifiers.down) {
return;
}
@ -263,7 +265,8 @@ export default function FaceLibrary() {
setSelectedFaces([]);
break;
}
});
},
);
if (!config) {
return <ActivityIndicator />;