From eafdcb3619869a7ac7c6fdc3ec70c5eb1a697ab3 Mon Sep 17 00:00:00 2001 From: Timo K Date: Tue, 28 Nov 2023 18:49:54 +0100 Subject: [PATCH] hehe... onLeave(error)... (we had an error because onLeave gets called with the button) Signed-off-by: Timo K --- src/room/InCallView.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index f0893c4b..f13e454c 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -109,7 +109,9 @@ export const ActiveCall: FC = (props) => { useEffect(() => { return () => { - livekitRoom?.disconnect(); + if (connState === ConnectionState.Connected) { + livekitRoom?.disconnect(); + } }; // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -381,7 +383,13 @@ export const InCallView: FC = ({ } buttons.push( - , + , ); footer = (