From e2cfc73916460a061ed8d92e03fc53b0495f7490 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Fri, 14 Mar 2025 10:42:48 -0600 Subject: [PATCH] fix bug in chat input --- .../ChatContainer/ChatContent/ChatInput/ChatInput.tsx | 1 + .../FileContainerHeader/MetricContainerHeaderButtons.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/ChatInput.tsx b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/ChatInput.tsx index 3a68443d1..07f075908 100644 --- a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/ChatInput.tsx +++ b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/ChatInput.tsx @@ -43,6 +43,7 @@ export const ChatInput: React.FC<{}> = React.memo(({}) => { onChange={onChange} onStop={onStopChat} loading={loading} + value={inputValue} disabledSubmit={disableSubmit} autoFocus ref={textAreaRef} diff --git a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderButtons.tsx b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderButtons.tsx index ad66a3980..221c9fd5f 100644 --- a/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderButtons.tsx +++ b/web/src/layouts/ChatLayout/FileContainer/FileContainerHeader/MetricContainerHeaderButtons.tsx @@ -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: , + 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 (