fix(frontend): rename ChatContext

This commit is contained in:
yassinedorbozgithub 2025-05-09 17:45:25 +01:00
parent 0bf199f76d
commit 7d3cca6f74

View File

@ -25,7 +25,7 @@ interface IChatContext {
setSubscriberId: Dispatch<string | null>;
}
const chatContext = createContext<IChatContext>({
const ChatContext = createContext<IChatContext>({
subscriber: null,
setSubscriberId: noop,
});
@ -49,7 +49,7 @@ export const ChatProvider = ({ children }: PropsWithChildren) => {
};
return (
<chatContext.Provider value={context}>{children}</chatContext.Provider>
<ChatContext.Provider value={context}>{children}</ChatContext.Provider>
);
};
@ -58,7 +58,7 @@ export const ChatProvider = ({ children }: PropsWithChildren) => {
* @description this hook is used to get the active chat
*/
export const useChat = () => {
const context = useContext(chatContext);
const context = useContext(ChatContext);
if (!context) {
throw new Error("useChat must be used within a ChatProvider");