fix: linting on build

This commit is contained in:
Matt 2023-06-14 16:49:21 +01:00
parent ec304e9272
commit 0bc4221b2c
2 changed files with 20 additions and 17 deletions

View File

@ -17,7 +17,7 @@ export const ApiKeyConfig = (): JSX.Element => {
}
};
const copyToClipboard = async (text) => {
const copyToClipboard = async (text: string) => {
try {
await navigator.clipboard.writeText(text);
} catch (err) {

View File

@ -34,24 +34,27 @@ export default function useChats() {
text: "Error occured while fetching your chats",
});
}
}, []);
}, [axiosInstance, publish]);
const fetchChat = useCallback(async (chatId?: UUID) => {
if (!chatId) return;
try {
console.log(`Fetching chat ${chatId}`);
const response = await axiosInstance.get<Chat>(`/chat/${chatId}`);
console.log(response.data);
const fetchChat = useCallback(
async (chatId?: UUID) => {
if (!chatId) return;
try {
console.log(`Fetching chat ${chatId}`);
const response = await axiosInstance.get<Chat>(`/chat/${chatId}`);
console.log(response.data);
setChat(response.data);
} catch (error) {
console.error(error);
publish({
variant: "danger",
text: `Error occured while fetching ${chatId}`,
});
}
}, []);
setChat(response.data);
} catch (error) {
console.error(error);
publish({
variant: "danger",
text: `Error occured while fetching ${chatId}`,
});
}
},
[axiosInstance, publish]
);
type ChatResponse = Omit<Chat, "chatId"> & { chatId: UUID | undefined };