remove listener
This commit is contained in:
parent
ba4598d25b
commit
21e93814bf
1 changed files with 0 additions and 16 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue