mirror of https://github.com/buster-so/buster.git
disable check
This commit is contained in:
parent
12acbc4264
commit
f84bf8e3d1
|
@ -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(
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue