mirror of https://github.com/buster-so/buster.git
invalidate metric on new message
This commit is contained in:
parent
1e8717c0e6
commit
84f1c80bb7
|
@ -46,7 +46,6 @@ export type BusterChatResponseMessage_file = {
|
|||
file_type: FileType;
|
||||
file_name: string;
|
||||
version_number: number;
|
||||
version_id: string;
|
||||
filter_version_id: string | null;
|
||||
metadata?: BusterChatResponseMessage_fileMetadata[];
|
||||
};
|
||||
|
|
|
@ -75,6 +75,11 @@ export const useChatStreamMessage = () => {
|
|||
{ id: responseMessage.id, version_number: responseMessage.version_number },
|
||||
queryClient
|
||||
);
|
||||
const options = queryKeys.metricsGetMetric(
|
||||
responseMessage.id,
|
||||
responseMessage.version_number
|
||||
);
|
||||
queryClient.invalidateQueries({ queryKey: options.queryKey });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -88,6 +93,7 @@ export const useChatStreamMessage = () => {
|
|||
normalizeChatMessage(iChatMessages);
|
||||
onUpdateChat(iChat);
|
||||
prefetchLastMessageMetricData(iChat, iChatMessages);
|
||||
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [queryKeys.chatsGetList().queryKey, queryKeys.metricsGetList().queryKey]
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue