mirror of https://github.com/buster-so/buster.git
query checks
This commit is contained in:
parent
70d5b8925f
commit
b08892744e
|
@ -34,11 +34,13 @@ const crosshairPlugin: Plugin<'line'> = {
|
||||||
|
|
||||||
// Initialize the crosshair state
|
// Initialize the crosshair state
|
||||||
beforeInit(chart: Chart) {
|
beforeInit(chart: Chart) {
|
||||||
|
if (!chart) return;
|
||||||
chart.$crosshair = { x: null, y: null };
|
chart.$crosshair = { x: null, y: null };
|
||||||
},
|
},
|
||||||
|
|
||||||
// Capture mouse events to update the crosshair coordinates
|
// Capture mouse events to update the crosshair coordinates
|
||||||
afterEvent(chart: Chart, args: { event: ChartEvent }) {
|
afterEvent(chart: Chart, args: { event: ChartEvent }) {
|
||||||
|
if (!chart) return;
|
||||||
const event = args.event;
|
const event = args.event;
|
||||||
if (event.type === 'mousemove') {
|
if (event.type === 'mousemove') {
|
||||||
chart.$crosshair = chart.$crosshair || { x: null, y: null };
|
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
|
// Draw the crosshair lines and labels after the chart is rendered
|
||||||
afterDraw(chart: Chart, args, options: CrosshairPluginOptions) {
|
afterDraw(chart: Chart, args, options: CrosshairPluginOptions) {
|
||||||
|
if (!chart) return;
|
||||||
const {
|
const {
|
||||||
ctx,
|
ctx,
|
||||||
chartArea: { top, bottom, left, right }
|
chartArea: { top, bottom, left, right }
|
||||||
} = chart;
|
} = chart;
|
||||||
const crosshair = chart.$crosshair;
|
const crosshair = chart.$crosshair;
|
||||||
if (!crosshair) return;
|
if (!crosshair || !ctx) return;
|
||||||
const { x, y } = crosshair;
|
const { x, y } = crosshair;
|
||||||
|
|
||||||
// Only draw if the pointer is within the chart area
|
// Only draw if the pointer is within the chart area
|
||||||
|
|
|
@ -95,7 +95,7 @@ export const InputTextArea = React.forwardRef<HTMLTextAreaElement, InputTextArea
|
||||||
|
|
||||||
const adjustHeight = useMemoizedFn(() => {
|
const adjustHeight = useMemoizedFn(() => {
|
||||||
const textarea = textareaRef.current;
|
const textarea = textareaRef.current;
|
||||||
if (!textarea || !autoResize || textarea.value === '') return;
|
if (!textarea || !autoResize) return;
|
||||||
|
|
||||||
const minHeight = calculateMinHeight();
|
const minHeight = calculateMinHeight();
|
||||||
if (!minHeight) return;
|
if (!minHeight) return;
|
||||||
|
|
|
@ -88,6 +88,9 @@ export const useChatStreamMessage = () => {
|
||||||
onUpdateChat(iChat);
|
onUpdateChat(iChat);
|
||||||
removeBlackBoxMessage({ messageId: iChat.message_ids[iChat.message_ids.length - 1] });
|
removeBlackBoxMessage({ messageId: iChat.message_ids[iChat.message_ids.length - 1] });
|
||||||
prefetchLastMessageMetricData(iChat, iChatMessages);
|
prefetchLastMessageMetricData(iChat, iChatMessages);
|
||||||
|
queryClient.invalidateQueries({
|
||||||
|
queryKey: [queryKeys.chatsGetList().queryKey, queryKeys.metricsGetList().queryKey]
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const stopChatCallback = useMemoizedFn((chatId: string) => {
|
const stopChatCallback = useMemoizedFn((chatId: string) => {
|
||||||
|
|
Loading…
Reference in New Issue