Leave JS output channel only if it exists

This commit is contained in:
Jonatan Kłosko 2022-02-10 11:25:37 +01:00
parent 7f19afe7af
commit 53aea7af6e

View file

@ -241,9 +241,11 @@ function getChannel(sessionId, { create = true } = {}) {
* Leaves the JS outputs channel tied to the current session.
*/
export function leaveChannel() {
channel.leave();
channel = null;
socket.disconnect();
if (channel) {
channel.leave();
channel = null;
socket.disconnect();
}
}
/**