mirror of https://github.com/buster-so/buster.git
remove some requests
This commit is contained in:
parent
17c57f6d75
commit
337569fd9c
|
@ -1,5 +1,4 @@
|
||||||
import type { RustApiError } from '../../buster_rest/errors';
|
import type { RustApiError } from '../../buster_rest/errors';
|
||||||
import type { BusterChatAsset } from './chatAssetInterfaces';
|
|
||||||
import type { BusterChat, BusterChatListItem } from './chatInterfaces';
|
import type { BusterChat, BusterChatListItem } from './chatInterfaces';
|
||||||
|
|
||||||
export enum ChatsResponses {
|
export enum ChatsResponses {
|
||||||
|
@ -29,12 +28,6 @@ export type Chat_getChat = {
|
||||||
onError?: (d: unknown | RustApiError) => void;
|
onError?: (d: unknown | RustApiError) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type Chat_getChatAsset = {
|
|
||||||
route: '/chats/get:getChatAsset';
|
|
||||||
callback: (d: BusterChatAsset) => void;
|
|
||||||
onError?: (d: unknown | RustApiError) => void;
|
|
||||||
};
|
|
||||||
|
|
||||||
/***** CHAT PROGRESS EVENTS START ******/
|
/***** CHAT PROGRESS EVENTS START ******/
|
||||||
|
|
||||||
export type ChatPost_initializeChat = {
|
export type ChatPost_initializeChat = {
|
||||||
|
@ -55,6 +48,5 @@ export type ChatResponseTypes =
|
||||||
| ChatList_getChatsList
|
| ChatList_getChatsList
|
||||||
| Chat_unsubscribed
|
| Chat_unsubscribed
|
||||||
| Chat_getChat
|
| Chat_getChat
|
||||||
| Chat_getChatAsset
|
|
||||||
| ChatPost_initializeChat
|
| ChatPost_initializeChat
|
||||||
| ChatPost_generatingTitle;
|
| ChatPost_generatingTitle;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
useContextSelector
|
useContextSelector
|
||||||
} from '@fluentui/react-context-selector';
|
} from '@fluentui/react-context-selector';
|
||||||
import { useBusterWebSocket } from '../BusterWebSocket';
|
import { useBusterWebSocket } from '../BusterWebSocket';
|
||||||
import type { BusterChatAsset, BusterChat, BusterChatMessage } from '@/api/buster_socket/chats';
|
import type { BusterChat } from '@/api/buster_socket/chats';
|
||||||
import { useMemoizedFn, useUnmount } from 'ahooks';
|
import { useMemoizedFn, useUnmount } from 'ahooks';
|
||||||
import type { FileType } from '@/api/buster_socket/chats';
|
import type { FileType } from '@/api/buster_socket/chats';
|
||||||
import {
|
import {
|
||||||
|
@ -17,7 +17,6 @@ import {
|
||||||
import { IBusterChat } from './interfaces';
|
import { IBusterChat } from './interfaces';
|
||||||
import { chatUpgrader } from './helpers';
|
import { chatUpgrader } from './helpers';
|
||||||
import { useHotkeys } from 'react-hotkeys-hook';
|
import { useHotkeys } from 'react-hotkeys-hook';
|
||||||
import { fi } from '@faker-js/faker';
|
|
||||||
|
|
||||||
export const useBusterChat = () => {
|
export const useBusterChat = () => {
|
||||||
const busterSocket = useBusterWebSocket();
|
const busterSocket = useBusterWebSocket();
|
||||||
|
@ -39,12 +38,6 @@ export const useBusterChat = () => {
|
||||||
return upgradedChat;
|
return upgradedChat;
|
||||||
});
|
});
|
||||||
|
|
||||||
const _onGetChatAsset = useMemoizedFn((asset: BusterChatAsset) => {
|
|
||||||
const { id, type } = asset;
|
|
||||||
console.log('TODO: handle this. Put the asset in their respective chat');
|
|
||||||
return asset;
|
|
||||||
});
|
|
||||||
|
|
||||||
// EMITTERS
|
// EMITTERS
|
||||||
|
|
||||||
const unsubscribeFromChat = useMemoizedFn(({ chatId }: { chatId: string }) => {
|
const unsubscribeFromChat = useMemoizedFn(({ chatId }: { chatId: string }) => {
|
||||||
|
@ -198,13 +191,3 @@ export const useBusterChatIndividual = ({ chatId: chatIdProp }: { chatId?: strin
|
||||||
chat
|
chat
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useBusterChatAssetIndividual = ({
|
|
||||||
chatId,
|
|
||||||
assetId,
|
|
||||||
type
|
|
||||||
}: {
|
|
||||||
chatId: string;
|
|
||||||
assetId: string;
|
|
||||||
type: FileType;
|
|
||||||
}) => {};
|
|
||||||
|
|
Loading…
Reference in New Issue