query checks

This commit is contained in:
Nate Kelley 2025-04-18 22:46:04 -06:00
parent 70d5b8925f
commit b08892744e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 8 additions and 2 deletions

View File

@ -34,11 +34,13 @@ const crosshairPlugin: Plugin<'line'> = {
// Initialize the crosshair state
beforeInit(chart: Chart) {
if (!chart) return;
chart.$crosshair = { x: null, y: null };
},
// Capture mouse events to update the crosshair coordinates
afterEvent(chart: Chart, args: { event: ChartEvent }) {
if (!chart) return;
const event = args.event;
if (event.type === 'mousemove') {
chart.$crosshair = chart.$crosshair || { x: null, y: null };
@ -54,12 +56,13 @@ const crosshairPlugin: Plugin<'line'> = {
// Draw the crosshair lines and labels after the chart is rendered
afterDraw(chart: Chart, args, options: CrosshairPluginOptions) {
if (!chart) return;
const {
ctx,
chartArea: { top, bottom, left, right }
} = chart;
const crosshair = chart.$crosshair;
if (!crosshair) return;
if (!crosshair || !ctx) return;
const { x, y } = crosshair;
// Only draw if the pointer is within the chart area

View File

@ -95,7 +95,7 @@ export const InputTextArea = React.forwardRef<HTMLTextAreaElement, InputTextArea
const adjustHeight = useMemoizedFn(() => {
const textarea = textareaRef.current;
if (!textarea || !autoResize || textarea.value === '') return;
if (!textarea || !autoResize) return;
const minHeight = calculateMinHeight();
if (!minHeight) return;

View File

@ -88,6 +88,9 @@ export const useChatStreamMessage = () => {
onUpdateChat(iChat);
removeBlackBoxMessage({ messageId: iChat.message_ids[iChat.message_ids.length - 1] });
prefetchLastMessageMetricData(iChat, iChatMessages);
queryClient.invalidateQueries({
queryKey: [queryKeys.chatsGetList().queryKey, queryKeys.metricsGetList().queryKey]
});
});
const stopChatCallback = useMemoizedFn((chatId: string) => {