Remove non-null assertion in ConversationProvider
- Add `createOptionalContext` that is used by `AuthContext` and `ConversationContext` to create a context with a hook
that can be used to retrieve its value and throw an error if it's undefined.
- In `router.tsx`, put `Messenger` inside `ConversationProvider`.
- In `ConversationListItem`, use the conversationId from the `ConversationContext ` instead of the url params.
- Fix bug in `CallInterface` with fullscreen.
- Remove unecessary useEffect dependency in `NotificationManager`.
Change-Id: Ib5f0ae6a0a34cdbdb02f871e36194376d945230d
diff --git a/client/src/managers/NotificationManager.tsx b/client/src/managers/NotificationManager.tsx
index 63eccc6..907efb5 100644
--- a/client/src/managers/NotificationManager.tsx
+++ b/client/src/managers/NotificationManager.tsx
@@ -19,7 +19,6 @@
import { useContext, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
-import { useAuthContext } from '../contexts/AuthProvider';
import { CallStatus } from '../contexts/CallProvider';
import { WebSocketContext } from '../contexts/WebSocketProvider';
import { WithChildren } from '../utils/utils';
@@ -30,7 +29,6 @@
export default ({ children }: WithChildren) => {
const webSocket = useContext(WebSocketContext);
const navigate = useNavigate();
- const { axiosInstance } = useAuthContext();
useEffect(() => {
if (!webSocket) {
@@ -53,7 +51,7 @@
return () => {
webSocket.unbind(WebSocketMessageType.CallBegin, callBeginListener);
};
- }, [webSocket, navigate, axiosInstance]);
+ }, [webSocket, navigate]);
return <>{children}</>;
};