Handle submit

This commit is contained in:
Adria Navarro 2025-04-24 10:21:48 +02:00
parent 5f88010a2e
commit d81640ef47
1 changed files with 4 additions and 1 deletions

View File

@ -31,6 +31,8 @@
$: disabled = !aiEnabled || creditsExceeded || readonly || promptLoading
$: animateBorder = !disabled && expanded
$: canSubmit = !readonly && !!value
function collapse() {
dispatch("collapse")
expanded = expandedOnly
@ -62,7 +64,7 @@
}
async function onPromptSubmit() {
if (readonly) {
if (!canSubmit) {
return
}
promptLoading = true
@ -155,6 +157,7 @@
? "#6E56FF"
: "var(--spectrum-global-color-gray-600)"}
size="S"
disabled={!canSubmit}
hoverable={!readonly}
hoverColor="#6E56FF"
name={promptLoading ? "StopCircle" : "PlayCircle"}