remove mocks

This commit is contained in:
Nate Kelley 2025-02-11 10:46:24 -07:00
parent fc7f83ff43
commit db50da5ea3
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
4 changed files with 10 additions and 44 deletions

View File

@ -4,7 +4,6 @@ import { useMemoizedFn } from 'ahooks';
import type { BusterChat } from '@/api/asset_interfaces';
import type { IBusterChat, IBusterChatMessage } from '../interfaces';
import { updateChatToIChat } from '@/utils/chat';
import { MOCK_CHAT } from './MOCK_CHAT';
export const useChatSubscriptions = ({
chatsRef,
@ -41,17 +40,16 @@ export const useChatSubscriptions = ({
});
const subscribeToChat = useMemoizedFn(({ chatId }: { chatId: string }) => {
_onGetChat(MOCK_CHAT);
// return busterSocket.emitAndOnce({
// emitEvent: {
// route: '/chats/get',
// payload: { id: chatId }
// },
// responseEvent: {
// route: '/chats/get:getChat',
// callback: _onGetChat
// }
// });
return busterSocket.emitAndOnce({
emitEvent: {
route: '/chats/get',
payload: { id: chatId }
},
responseEvent: {
route: '/chats/get:getChat',
callback: _onGetChat
}
});
});
return {

View File

@ -10,7 +10,6 @@ import {
import { updateChatToIChat } from '@/utils/chat';
import { useAutoAppendThought } from './useAutoAppendThought';
import { useHotkeys } from 'react-hotkeys-hook';
import { MOCK_CHAT } from '../ChatProvider/MOCK_CHAT';
export const useChatUpdateMessage = () => {
const busterSocket = useBusterWebSocket();
@ -131,24 +130,6 @@ export const useChatUpdateMessage = () => {
stopListeningForGeneratingReasoningMessage();
});
useHotkeys('x', () => {
const mock_generatingResponseMessageCallback: ChatEvent_GeneratingReasoningMessage = {
chat_id: MOCK_CHAT.id,
message_id: MOCK_CHAT.messages[0].id,
progress: 'completed',
reasoning: {
id: MOCK_CHAT.messages[0].id,
type: 'file',
file_type: 'metric',
file_name: 'metric.json',
version_id: '1',
version_number: 1,
status: 'completed'
}
};
_generatingReasoningMessageCallback(mock_generatingResponseMessageCallback);
});
return {
completeChatCallback,
startListeningForChatProgress,

View File

@ -9,7 +9,6 @@ import { useBusterWebSocket } from '../BusterWebSocket';
import type { BusterMetricData } from '../Metrics';
import { MetricEvent_fetchingData } from '@/api/buster_socket/metrics/eventsInterfaces';
import { DEFAULT_MESSAGE_DATA } from './config';
import { createMockData } from './MOCK_DATA';
const useMetricData = () => {
const busterSocket = useBusterWebSocket();
@ -100,12 +99,6 @@ const useMetricData = () => {
fetching: true
});
setTimeout(() => {
//TODO: remove mock data
// _setMetricData(metricId, { ...MOCK_DATA, fetched: true });
onSetDataForMetric(createMockData(metricId));
}, Math.random() * 5000);
return await busterSocket.emitAndOnce({
emitEvent: {
route: '/metrics/data',

View File

@ -1,7 +1,6 @@
import { useMemoizedFn } from 'ahooks';
import { useBusterAssetsContextSelector } from '../../Assets/BusterAssetsProvider';
import { IBusterMetric } from '../interfaces';
import { createMockMetric } from './MOCK_METRIC';
import { useBusterWebSocket } from '../../BusterWebSocket';
import { BusterMetric } from '@/api/asset_interfaces';
import { RustApiError } from '@/api/buster_rest/errors';
@ -57,11 +56,6 @@ export const useMetricSubscribe = ({
_setLoadingMetric(metricId);
//TODO: remove this
setTimeout(() => {
_onGetMetricState(createMockMetric(metricId));
}, 300);
return await busterSocket.emitAndOnce({
emitEvent: {
route: '/metrics/get',