update table chart flow

This commit is contained in:
Nate Kelley 2025-04-19 23:02:48 -06:00
parent 2bdccb6a7c
commit 7daecfce7e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 17 additions and 16 deletions

View File

@ -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 }) => {

View File

@ -31,8 +31,7 @@ const BusterTableChartBase: React.FC<BusterTableChartProps> = ({
tableHeaderFontColor,
tableColumnFontColor
}) => {
const { onUpdateMetricChartConfig, onSaveMetricToServer, onInitializeTableColumnWidths } =
useUpdateMetricChart();
const { onUpdateMetricChartConfig, onInitializeTableColumnWidths } = useUpdateMetricChart();
const onChangeConfig = useMemoizedFn((config: Partial<IBusterMetricChartConfig>) => {
if (readOnly) return;

View File

@ -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
});
}
}
);

View File

@ -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;
}
});
});