Skip to content

Commit

Permalink
🐛 fix: slove button loading not work
Browse files Browse the repository at this point in the history
  • Loading branch information
ONLY-yours committed Feb 7, 2024
1 parent f6ee50c commit 490271c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/ProChat/components/InputArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Flexbox } from 'react-layout-kit';

import { useStore } from '../../store';

import { useMergedState } from 'rc-util';
import ActionBar from './ActionBar';
import { AutoCompleteTextArea } from './AutoCompleteTextArea';

Expand Down Expand Up @@ -77,13 +76,9 @@ export const ChatInputArea = (props: ChatInputAreaProps) => {
const { styles, theme } = useStyles();
const { mobile } = useResponsive();

const [ButtonLoading, setButtonLoading] = useMergedState(isLoading);

const send = async () => {
if (onSend) {
setButtonLoading(true);
const success = await onSend(message);
setButtonLoading(false);
if (success) {
sendMessage(message);
setMessage('');
Expand Down Expand Up @@ -140,7 +135,7 @@ export const ChatInputArea = (props: ChatInputAreaProps) => {
/>
{mobile ? null : (
<Button
loading={ButtonLoading}
loading={isLoading}
type="text"
className={styles.btn}
onClick={() => send()}
Expand Down

0 comments on commit 490271c

Please sign in to comment.