disable check

This commit is contained in:
Nate Kelley 2025-07-13 08:28:11 -06:00
parent 12acbc4264
commit f84bf8e3d1
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 14 additions and 18 deletions

View File

@ -108,12 +108,9 @@ const SubmitButton: React.FC<{
onSubmitPreflight: () => void; onSubmitPreflight: () => void;
onStop?: () => void; onStop?: () => void;
}> = React.memo(({ disabled, sendIcon, loading, loadingIcon, onSubmitPreflight, onStop }) => { }> = React.memo(({ disabled, sendIcon, loading, loadingIcon, onSubmitPreflight, onStop }) => {
const memoizedPrefix = useMemo(() => { const prefix = (
return (
<div <div
className={cn( className={cn('relative h-4 w-4 transition-all duration-300 ease-out will-change-transform')}>
'relative h-4 w-4 transition-all duration-300 ease-out will-change-transform'
)}>
<div <div
className={`absolute inset-0 transition-all duration-300 ease-out ${loading ? 'scale-80 opacity-0' : 'scale-100 opacity-100'}`}> className={`absolute inset-0 transition-all duration-300 ease-out ${loading ? 'scale-80 opacity-0' : 'scale-100 opacity-100'}`}>
{sendIcon} {sendIcon}
@ -124,13 +121,12 @@ const SubmitButton: React.FC<{
</div> </div>
</div> </div>
); );
}, [loading, sendIcon, loadingIcon]);
return ( return (
<Button <Button
rounding={'large'} rounding={'large'}
variant="black" variant="black"
prefix={memoizedPrefix} prefix={prefix}
onClick={loading && onStop ? onStop : onSubmitPreflight} onClick={loading && onStop ? onStop : onSubmitPreflight}
disabled={disabled} disabled={disabled}
className={cn( className={cn(

View File

@ -17,8 +17,8 @@ export const ChatInput: React.FC = React.memo(() => {
const [inputValue, setInputValue] = useState(''); const [inputValue, setInputValue] = useState('');
const disableSubmit = useMemo(() => { const disableSubmit = useMemo(() => {
return !inputHasText(inputValue); return !inputHasText(inputValue) && !isStreamingMessage;
}, [inputValue]); }, [inputValue, isStreamingMessage]);
const { onSubmitPreflight, onStopChat } = useChatInputFlow({ const { onSubmitPreflight, onStopChat } = useChatInputFlow({
disableSubmit, disableSubmit,