remove listener

This commit is contained in:
Nate 2024-11-19 14:33:05 -08:00
parent ba4598d25b
commit 21e93814bf

View file

@ -114,22 +114,6 @@ export function ToolCallDiv(props: ToolCallDivProps) {
}
}, [props.toolCall.function.arguments]);
useEffect(() => {
function handleKeyDown(e: KeyboardEvent) {
if (e.key === "Tab") {
e.preventDefault();
callTool();
}
if (e.key === "Backspace" && e.metaKey) {
e.preventDefault();
cancelTool();
}
}
window.addEventListener("keydown", handleKeyDown);
return () => window.removeEventListener("keydown", handleKeyDown);
}, []);
async function cancelTool() {
setState("canceled");
}