diff --git a/web/src/components/features/auth/LoginForm.tsx b/web/src/components/features/auth/LoginForm.tsx index 31661f915..d01e88e70 100644 --- a/web/src/components/features/auth/LoginForm.tsx +++ b/web/src/components/features/auth/LoginForm.tsx @@ -54,8 +54,8 @@ export const LoginForm: React.FC<{}> = ({}) => { if (res?.error) throw res.error; } catch (error: any) { errorFallback(error); + setLoading(null); } - setLoading(null); } ); @@ -66,8 +66,8 @@ export const LoginForm: React.FC<{}> = ({}) => { if (res?.error) throw res.error; } catch (error: any) { errorFallback(error); + setLoading(null); } - setLoading(null); }); const onSignInWithGithub = useMemoizedFn(async () => { @@ -77,8 +77,8 @@ export const LoginForm: React.FC<{}> = ({}) => { if (res?.error) throw res.error; } catch (error: any) { errorFallback(error); + setLoading(null); } - setLoading(null); }); const onSignInWithAzure = useMemoizedFn(async () => { @@ -101,8 +101,8 @@ export const LoginForm: React.FC<{}> = ({}) => { setSignUpSuccess(true); } catch (error: any) { errorFallback(error); + setLoading(null); } - setLoading(null); }); const onSubmitClick = useMemoizedFn((d: { email: string; password: string }) => { diff --git a/web/src/components/ui/charts/TableChart/BusterTableChart.tsx b/web/src/components/ui/charts/TableChart/BusterTableChart.tsx index 097d14b64..8e92da2d7 100644 --- a/web/src/components/ui/charts/TableChart/BusterTableChart.tsx +++ b/web/src/components/ui/charts/TableChart/BusterTableChart.tsx @@ -31,8 +31,7 @@ const BusterTableChartBase: React.FC = ({ tableHeaderFontColor, tableColumnFontColor }) => { - const { onUpdateMetricChartConfig, onSaveMetricToServer, onInitializeTableColumnWidths } = - useUpdateMetricChart(); + const { onUpdateMetricChartConfig, onInitializeTableColumnWidths } = useUpdateMetricChart(); const onChangeConfig = useMemoizedFn((config: Partial) => { if (readOnly) return; diff --git a/web/src/context/Metrics/useUpdateMetricChart.ts b/web/src/context/Metrics/useUpdateMetricChart.ts index 381371701..b727f85e9 100644 --- a/web/src/context/Metrics/useUpdateMetricChart.ts +++ b/web/src/context/Metrics/useUpdateMetricChart.ts @@ -32,7 +32,7 @@ export const useUpdateMetricChart = (props?: { metricId?: string; chatId?: strin updateVersion: !chatId }); const { mutateAsync: saveMetricToServerWithoutSideEffects } = useSaveMetric({ - updateOnSave: false + updateOnSave: true }); const getMetricMemoized = useGetMetricMemoized(); @@ -141,16 +141,16 @@ export const useUpdateMetricChart = (props?: { metricId?: string; chatId?: strin tableColumnWidths }; + setOriginalMetric({ + ...originalMetric, + chart_config: newChartConfig + }); + saveMetricToServerWithoutSideEffects({ id: metricId, chart_config: newChartConfig, update_version: false }); - - setOriginalMetric({ - ...originalMetric, - chart_config: newChartConfig - }); } } ); diff --git a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts index 330f482bd..67e8b4b89 100644 --- a/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts +++ b/web/src/layouts/ChatLayout/ChatContainer/ChatContent/ChatInput/useChatInputFlow.ts @@ -3,7 +3,7 @@ import { useChatIndividualContextSelector } from '@/layouts/ChatLayout/ChatConte import { useMemoizedFn } from '@/hooks'; import { useBusterNewChatContextSelector } from '@/context/Chats'; import { useBusterNotifications } from '@/context/BusterNotifications'; -import { timeout } from '@/lib'; +import { timeout } from '@/lib/timeout'; type FlowType = 'followup-chat' | 'followup-metric' | 'followup-dashboard' | 'new'; @@ -100,11 +100,13 @@ export const useChatInputFlow = ({ }, onOk: async () => { onResetToOriginal(); - - return await method(); + await timeout(25); + method(); + return; }, onCancel: async () => { - return await method(); + method(); + return; } }); });