mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-20 21:04:17 +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.
|
||||
*/
|
||||
export function leaveChannel() {
|
||||
channel.leave();
|
||||
channel = null;
|
||||
socket.disconnect();
|
||||
if (channel) {
|
||||
channel.leave();
|
||||
channel = null;
|
||||
socket.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue