forked from github/cinny
Seems to sort out the hangup status button bug the occurred after joining a call via lobby
This commit is contained in:
@@ -123,14 +123,6 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||||||
[setViewedCallRoomIdState]
|
[setViewedCallRoomIdState]
|
||||||
);
|
);
|
||||||
|
|
||||||
const hangUp = useCallback(() => {
|
|
||||||
logger.debug(`CallContext: Hang up called.`);
|
|
||||||
activeClientWidgetApi?.transport.send(`${WIDGET_HANGUP_ACTION}`, {});
|
|
||||||
viewedClientWidgetApi?.transport.send(`${WIDGET_HANGUP_ACTION}`, {});
|
|
||||||
setActiveCallRoomIdState(null);
|
|
||||||
setIsCallActive(false);
|
|
||||||
}, [activeClientWidgetApi?.transport, viewedClientWidgetApi?.transport]);
|
|
||||||
|
|
||||||
const setActiveClientWidgetApi = useCallback(
|
const setActiveClientWidgetApi = useCallback(
|
||||||
(clientWidgetApi: ClientWidgetApi | null, roomId: string | null) => {
|
(clientWidgetApi: ClientWidgetApi | null, roomId: string | null) => {
|
||||||
setActiveClientWidgetApiState(clientWidgetApi);
|
setActiveClientWidgetApiState(clientWidgetApi);
|
||||||
@@ -186,6 +178,14 @@ export function CallProvider({ children }: CallProviderProps) {
|
|||||||
[viewedClientWidgetApi, viewedClientWidgetApiRoomId, setViewedClientWidgetApi]
|
[viewedClientWidgetApi, viewedClientWidgetApiRoomId, setViewedClientWidgetApi]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const hangUp = useCallback(() => {
|
||||||
|
logger.debug(`CallContext: Hang up called.`);
|
||||||
|
activeClientWidgetApi?.transport.send(`${WIDGET_HANGUP_ACTION}`, {});
|
||||||
|
setActiveClientWidgetApi(null, null);
|
||||||
|
setViewedCallRoomId(activeCallRoomId);
|
||||||
|
setIsCallActive(false);
|
||||||
|
}, [activeCallRoomId, activeClientWidgetApi?.transport, setActiveClientWidgetApi, setViewedCallRoomId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!activeCallRoomId && !viewedCallRoomId) {
|
if (!activeCallRoomId && !viewedCallRoomId) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user