mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-22 22:05:03 +08:00
Leave JS output channel only if it exists
This commit is contained in:
parent
7f19afe7af
commit
53aea7af6e
1 changed files with 5 additions and 3 deletions
|
@ -241,9 +241,11 @@ function getChannel(sessionId, { create = true } = {}) {
|
||||||
* Leaves the JS outputs channel tied to the current session.
|
* Leaves the JS outputs channel tied to the current session.
|
||||||
*/
|
*/
|
||||||
export function leaveChannel() {
|
export function leaveChannel() {
|
||||||
|
if (channel) {
|
||||||
channel.leave();
|
channel.leave();
|
||||||
channel = null;
|
channel = null;
|
||||||
socket.disconnect();
|
socket.disconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue