Refactor livekit disconnect to use an effect hook. (#1925)
--------- Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
@@ -15,7 +15,6 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { Room } from "livekit-client";
|
||||
|
||||
import { PosthogAnalytics } from "./analytics/PosthogAnalytics";
|
||||
import { LivekitFocus } from "./livekit/LivekitFocus";
|
||||
@@ -69,10 +68,8 @@ const widgetPostHangupProcedure = async (
|
||||
|
||||
export async function leaveRTCSession(
|
||||
rtcSession: MatrixRTCSession,
|
||||
livekitRoom: Room | undefined,
|
||||
): Promise<void> {
|
||||
await rtcSession.leaveRoomSession();
|
||||
await livekitRoom?.disconnect();
|
||||
if (widget) {
|
||||
await widgetPostHangupProcedure(widget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user