Skip to content

Commit

Permalink
Merge branch 'main' into experiment/temporary-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
Orenoid committed Dec 10, 2024
2 parents c529e72 + 543e202 commit 9bfa3bf
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/app/chat/components/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export function MessageInput({
</div>;
}

let enableVoiceModeShortcutTimer: NodeJS.Timeout
// let enableVoiceModeShortcutTimer: NodeJS.Timeout

function TextInput(
{ allowEdit, msgListSwitchSignal, addMessage, updateMessage, revisionMessage }: {
Expand Down Expand Up @@ -654,19 +654,19 @@ function TextInput(
}
value={msg.content} onChange={(e) => setMsg(msg.updateContent(e.target.value))}
readOnly={!isTyping}
onKeyUp={(e) => {
if (e.key === 'v') {
clearTimeout(enableVoiceModeShortcutTimer)
setMsg(msg.updateContent(msg.content + 'v'))
}
onKeyUp={() => {
// if (e.key === 'v') {
// clearTimeout(enableVoiceModeShortcutTimer)
// setMsg(msg.updateContent(msg.content + 'v'))
// }
}}
onKeyDown={(e) => {
if (e.key === 'v' && !(e.metaKey || e.ctrlKey)) {
e.preventDefault()
enableVoiceModeShortcutTimer = setTimeout(() => {
enableVoiceMode()
}, 1000)
}
// if (e.key === 'v' && !(e.metaKey || e.ctrlKey)) {
// e.preventDefault()
// enableVoiceModeShortcutTimer = setTimeout(() => {
// enableVoiceMode()
// }, 1000)
// }
// if (e.key === 'Enter' && e.ctrlKey) {
// e.preventDefault();
// handleSend(msg, { generateAssistantMsg: false });
Expand Down

0 comments on commit 9bfa3bf

Please sign in to comment.