mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
review + found unnecassary code
Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -107,15 +107,12 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
|
|||||||
props.e2eeConfig,
|
props.e2eeConfig,
|
||||||
);
|
);
|
||||||
|
|
||||||
const cleanup = useCallback(() => {
|
|
||||||
if (connState === ConnectionState.Connected) {
|
|
||||||
livekitRoom?.disconnect();
|
|
||||||
}
|
|
||||||
}, [livekitRoom, connState]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
return cleanup;
|
return () => {
|
||||||
}, [cleanup, livekitRoom]);
|
livekitRoom?.disconnect();
|
||||||
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, []);
|
||||||
|
|
||||||
if (!livekitRoom) return null;
|
if (!livekitRoom) return null;
|
||||||
|
|
||||||
@@ -207,14 +204,6 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
(muted) => muteStates.audio.setEnabled?.(!muted),
|
(muted) => muteStates.audio.setEnabled?.(!muted),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLeavePress = useCallback(() => {
|
|
||||||
// Disconnect from the room. We don't do this in onLeave because that's
|
|
||||||
// also called on an unintentional disconnect. Plus we don't have the
|
|
||||||
// livekit room in onLeave anyway.
|
|
||||||
livekitRoom.disconnect();
|
|
||||||
onLeave();
|
|
||||||
}, [livekitRoom, onLeave]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
widget?.api.transport.send(
|
widget?.api.transport.send(
|
||||||
layout === "grid"
|
layout === "grid"
|
||||||
@@ -392,11 +381,7 @@ export const InCallView: FC<InCallViewProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
buttons.push(
|
buttons.push(
|
||||||
<HangupButton
|
<HangupButton key="6" onPress={onLeave} data-testid="incall_leave" />,
|
||||||
key="6"
|
|
||||||
onPress={onLeavePress}
|
|
||||||
data-testid="incall_leave"
|
|
||||||
/>,
|
|
||||||
);
|
);
|
||||||
footer = (
|
footer = (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Reference in New Issue
Block a user