Fix hotkey
This commit is contained in:
@@ -9,7 +9,7 @@ import { doingChat, previewBody, sendChat } from "./process/index.svelte"
|
|||||||
import { getRequestLog } from "./globalApi.svelte"
|
import { getRequestLog } from "./globalApi.svelte"
|
||||||
|
|
||||||
export function initHotkey(){
|
export function initHotkey(){
|
||||||
document.addEventListener('keydown', (ev) => {
|
document.addEventListener('keydown', async (ev) => {
|
||||||
if(
|
if(
|
||||||
!ev.ctrlKey &&
|
!ev.ctrlKey &&
|
||||||
!ev.altKey &&
|
!ev.altKey &&
|
||||||
@@ -154,7 +154,9 @@ export function initHotkey(){
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
alertWait("Loading...")
|
alertWait("Loading...")
|
||||||
sendChat(-1, {
|
ev.preventDefault()
|
||||||
|
ev.stopPropagation()
|
||||||
|
await sendChat(-1, {
|
||||||
previewPrompt: true
|
previewPrompt: true
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ export function initHotkey(){
|
|||||||
md += '```json\n' + JSON.stringify(JSON.parse(previewBody), null, 2).replaceAll('```', '\\`\\`\\`') + '\n```\n'
|
md += '```json\n' + JSON.stringify(JSON.parse(previewBody), null, 2).replaceAll('```', '\\`\\`\\`') + '\n```\n'
|
||||||
doingChat.set(false)
|
doingChat.set(false)
|
||||||
alertMd(md)
|
alertMd(md)
|
||||||
break
|
return
|
||||||
}
|
}
|
||||||
case 'toggleLog':{
|
case 'toggleLog':{
|
||||||
alertMd(getRequestLog())
|
alertMd(getRequestLog())
|
||||||
|
|||||||
Reference in New Issue
Block a user