Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Ensure the CallComposite and CallWithChatComposite side pane's are closed if the call is rejoined",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Ensure the CallComposite and CallWithChatComposite side pane's are closed if the call is rejoined",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,17 @@ const MainScreen = (props: MainScreenProps): JSX.Element => {
onSidePaneIdChange?.(sidePaneRenderer?.id);
}, [sidePaneRenderer?.id, onSidePaneIdChange]);

// When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.
useEffect(() => {
const closeSidePane = (): void => {
setSidePaneRenderer(undefined);
};
adapter.on('callEnded', closeSidePane);
return () => {
adapter.off('callEnded', closeSidePane);
};
}, [adapter]);

/* @conditional-compile-remove(capabilities) */
const capabilitiesChangedInfoAndRole = useSelector(capabilitiesChangedInfoAndRoleSelector);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ export class _MockCallAdapter implements CallAdapter {
throw Error('sendDtmfTone not implemented');
}
on(): void {
throw Error('on not implemented');
return;
}
off(): void {
throw Error('off not implemented');
return;
}
/* @conditional-compile-remove(PSTN-calls) */
getEnvironmentInfo(): Promise<EnvironmentInfo> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
);

const onSidePaneIdChange = useCallback(
(sidePaneId) => {
(sidePaneId: string | undefined) => {
// If the pane is switched to something other than chat, removing rendering chat.
if (sidePaneId && sidePaneId !== 'chat') {
closeChat();
Expand All @@ -620,6 +620,14 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
[closeChat]
);

// When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.
useEffect(() => {
callAdapter.on('callEnded', closeChat);
return () => {
callAdapter.off('callEnded', closeChat);
};
}, [callAdapter, closeChat]);

return (
<div ref={containerRef} className={mergeStyles(containerDivStyles)}>
<Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>
Expand Down