fix: update prompt input submit handler (#22566)
This commit is contained in:
@@ -3,7 +3,7 @@ import { showToast } from "@opencode-ai/ui/toast"
|
|||||||
import { base64Encode } from "@opencode-ai/util/encode"
|
import { base64Encode } from "@opencode-ai/util/encode"
|
||||||
import { Binary } from "@opencode-ai/util/binary"
|
import { Binary } from "@opencode-ai/util/binary"
|
||||||
import { useNavigate, useParams } from "@solidjs/router"
|
import { useNavigate, useParams } from "@solidjs/router"
|
||||||
import type { Accessor } from "solid-js"
|
import { batch, type Accessor } from "solid-js"
|
||||||
import type { FileSelection } from "@/context/file"
|
import type { FileSelection } from "@/context/file"
|
||||||
import { useGlobalSync } from "@/context/global-sync"
|
import { useGlobalSync } from "@/context/global-sync"
|
||||||
import { useLanguage } from "@/context/language"
|
import { useLanguage } from "@/context/language"
|
||||||
@@ -138,13 +138,17 @@ export async function sendFollowupDraft(input: FollowupSendInput) {
|
|||||||
messageID,
|
messageID,
|
||||||
})
|
})
|
||||||
|
|
||||||
setBusy()
|
batch(() => {
|
||||||
add()
|
setBusy()
|
||||||
|
add()
|
||||||
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!(await wait())) {
|
if (!(await wait())) {
|
||||||
setIdle()
|
batch(() => {
|
||||||
remove()
|
setIdle()
|
||||||
|
remove()
|
||||||
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +162,10 @@ export async function sendFollowupDraft(input: FollowupSendInput) {
|
|||||||
})
|
})
|
||||||
return true
|
return true
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setIdle()
|
batch(() => {
|
||||||
remove()
|
setIdle()
|
||||||
|
remove()
|
||||||
|
})
|
||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user