refac
This commit is contained in:
1 parent
98b9df0398
commit
bbfdbd59f2
1 file changed
+18
@@ -355,6 +355,24 @@
|
|||||||
console.log('Shortcut triggered: GENERATE_MESSAGE_PAIR');
|
console.log('Shortcut triggered: GENERATE_MESSAGE_PAIR');
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
document.getElementById('generate-message-pair-button')?.click();
|
document.getElementById('generate-message-pair-button')?.click();
|
||||||
|
} else if (shortcut === Shortcut.ALLOW_TOOL_CALL) {
|
||||||
|
const button = [...document.getElementsByClassName('tool-call-allow-button')]
|
||||||
|
.reverse()
|
||||||
|
.find((el) => !(el as HTMLButtonElement).disabled) as HTMLButtonElement | undefined;
|
||||||
|
if (button) {
|
||||||
|
console.log('Shortcut triggered: ALLOW_TOOL_CALL');
|
||||||
|
event.preventDefault();
|
||||||
|
button.click();
|
||||||
|
}
|
||||||
|
} else if (shortcut === Shortcut.DENY_TOOL_CALL) {
|
||||||
|
const button = [...document.getElementsByClassName('tool-call-deny-button')]
|
||||||
|
.reverse()
|
||||||
|
.find((el) => !(el as HTMLButtonElement).disabled) as HTMLButtonElement | undefined;
|
||||||
|
if (button) {
|
||||||
|
console.log('Shortcut triggered: DENY_TOOL_CALL');
|
||||||
|
event.preventDefault();
|
||||||
|
button.click();
|
||||||
|
}
|
||||||
} else if (
|
} else if (
|
||||||
shortcut === Shortcut.REGENERATE_RESPONSE &&
|
shortcut === Shortcut.REGENERATE_RESPONSE &&
|
||||||
document.activeElement?.id === 'chat-input'
|
document.activeElement?.id === 'chat-input'
|
||||||
|
|||||||
Reference in new issue
Block a user