fix(webui): nudge model setup on blocked submit
This commit is contained in:
@@ -1036,6 +1036,7 @@ export function ThreadComposer({
|
||||
} | null>(null);
|
||||
const [inlineError, setInlineError] = useState<string | null>(null);
|
||||
const [sendPending, setSendPending] = useState(false);
|
||||
const [modelSetupAttentionRequest, setModelSetupAttentionRequest] = useState(0);
|
||||
const interactionDisabled = !!disabled || sendPending;
|
||||
const [voiceErrorFading, setVoiceErrorFading] = useState(false);
|
||||
const [slashMenuDismissed, setSlashMenuDismissed] = useState(false);
|
||||
@@ -2008,7 +2009,9 @@ export function ThreadComposer({
|
||||
|
||||
const submit = useCallback(() => {
|
||||
if (modelNeedsSetup) {
|
||||
onModelBadgeClick?.();
|
||||
if (hasComposerContent) {
|
||||
setModelSetupAttentionRequest((request) => request + 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!canSend) return;
|
||||
@@ -2112,11 +2115,11 @@ export function ThreadComposer({
|
||||
clear,
|
||||
clearComposerText,
|
||||
hasTouchPrimaryPointer,
|
||||
hasComposerContent,
|
||||
handleStop,
|
||||
isStreaming,
|
||||
maxTextBytes,
|
||||
modelNeedsSetup,
|
||||
onModelBadgeClick,
|
||||
onSend,
|
||||
onStop,
|
||||
onQuotedContextChange,
|
||||
@@ -2546,6 +2549,7 @@ export function ThreadComposer({
|
||||
provider={modelProvider}
|
||||
providerLabel={modelProviderLabel}
|
||||
needsSetup={modelNeedsSetup}
|
||||
attentionRequest={modelSetupAttentionRequest}
|
||||
fallbackModelName={fallbackModelName}
|
||||
isHero={isHero}
|
||||
onClick={modelNeedsSetup ? onModelBadgeClick : undefined}
|
||||
|
||||
Reference in New Issue
Block a user