mirror of https://github.com/buster-so/buster.git
fix bug in chat input
This commit is contained in:
parent
3b2ca0062a
commit
e2cfc73916
|
@ -43,6 +43,7 @@ export const ChatInput: React.FC<{}> = React.memo(({}) => {
|
|||
onChange={onChange}
|
||||
onStop={onStopChat}
|
||||
loading={loading}
|
||||
value={inputValue}
|
||||
disabledSubmit={disableSubmit}
|
||||
autoFocus
|
||||
ref={textAreaRef}
|
||||
|
|
|
@ -113,7 +113,7 @@ const ShareMetricButtonLocal = React.memo(({ metricId }: { metricId: string }) =
|
|||
ShareMetricButtonLocal.displayName = 'ShareMetricButtonLocal';
|
||||
|
||||
const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
||||
const { mutateAsync: deleteMetric } = useDeleteMetric();
|
||||
const { mutateAsync: deleteMetric, isPending: isDeletingMetric } = useDeleteMetric();
|
||||
const { openSuccessMessage } = useBusterNotifications();
|
||||
const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile);
|
||||
|
||||
|
@ -123,6 +123,7 @@ const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
|||
label: 'Delete',
|
||||
value: 'delete',
|
||||
icon: <Trash />,
|
||||
loading: isDeletingMetric,
|
||||
onClick: async () => {
|
||||
await deleteMetric({ ids: [metricId] });
|
||||
openSuccessMessage('Metric deleted');
|
||||
|
@ -130,7 +131,7 @@ const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
|||
}
|
||||
}
|
||||
],
|
||||
[deleteMetric, metricId, openSuccessMessage, onSetSelectedFile]
|
||||
[deleteMetric, isDeletingMetric, metricId, openSuccessMessage, onSetSelectedFile]
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue