mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 23:30:28 +03:00
Seems to sort out the hangup status button bug the occurred after joining a call via lobby
This commit is contained in:
parent
872e9a257f
commit
0b6009aaee
1 changed files with 8 additions and 8 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue