fix
Some checks failed
Deploy / deploy (build, debian, 22) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822) (push) Has been cancelled

This commit is contained in:
2026-05-09 01:30:36 -06:00
parent 53a0759507
commit f7817d8c26
6 changed files with 95 additions and 124 deletions

View File

@@ -28,10 +28,8 @@ export function setOnCodeComplete(fn: typeof _onCodeComplete) {
}
let ws: WebSocket | null = null
let _currentTaskId = 0
export function connectPrompt(taskId: number) {
_currentTaskId = taskId
currentTaskId.value = taskId
if (ws) ws.close()
@@ -102,7 +100,6 @@ export function disconnectPrompt() {
streaming.value = false
streamingContent.value = ""
currentTaskId.value = 0
_currentTaskId = 0
_onCodeComplete = null
}
@@ -122,8 +119,15 @@ export function stopPrompt() {
}
streaming.value = false
streamingContent.value = ""
if (_currentTaskId) {
connectPrompt(_currentTaskId)
if (currentTaskId.value) {
connectPrompt(currentTaskId.value)
}
}
export function removeMessagePair(assistantMsgId: number) {
const idx = messages.value.findIndex((m) => m.id === assistantMsgId)
if (idx >= 1) {
messages.value.splice(idx - 1, 2)
}
}