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}
|
onChange={onChange}
|
||||||
onStop={onStopChat}
|
onStop={onStopChat}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
value={inputValue}
|
||||||
disabledSubmit={disableSubmit}
|
disabledSubmit={disableSubmit}
|
||||||
autoFocus
|
autoFocus
|
||||||
ref={textAreaRef}
|
ref={textAreaRef}
|
||||||
|
|
|
@ -113,7 +113,7 @@ const ShareMetricButtonLocal = React.memo(({ metricId }: { metricId: string }) =
|
||||||
ShareMetricButtonLocal.displayName = 'ShareMetricButtonLocal';
|
ShareMetricButtonLocal.displayName = 'ShareMetricButtonLocal';
|
||||||
|
|
||||||
const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
||||||
const { mutateAsync: deleteMetric } = useDeleteMetric();
|
const { mutateAsync: deleteMetric, isPending: isDeletingMetric } = useDeleteMetric();
|
||||||
const { openSuccessMessage } = useBusterNotifications();
|
const { openSuccessMessage } = useBusterNotifications();
|
||||||
const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile);
|
const onSetSelectedFile = useChatLayoutContextSelector((x) => x.onSetSelectedFile);
|
||||||
|
|
||||||
|
@ -123,6 +123,7 @@ const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
||||||
label: 'Delete',
|
label: 'Delete',
|
||||||
value: 'delete',
|
value: 'delete',
|
||||||
icon: <Trash />,
|
icon: <Trash />,
|
||||||
|
loading: isDeletingMetric,
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
await deleteMetric({ ids: [metricId] });
|
await deleteMetric({ ids: [metricId] });
|
||||||
openSuccessMessage('Metric deleted');
|
openSuccessMessage('Metric deleted');
|
||||||
|
@ -130,7 +131,7 @@ const ThreeDotMenuButton = React.memo(({ metricId }: { metricId: string }) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[deleteMetric, metricId, openSuccessMessage, onSetSelectedFile]
|
[deleteMetric, isDeletingMetric, metricId, openSuccessMessage, onSetSelectedFile]
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue