Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close output views on notebook closed #7633

Merged
merged 1 commit into from Dec 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/notebook-extension/src/index.ts
Expand Up @@ -1668,16 +1668,17 @@ function addCommands(
const updateCloned = () => {
void clonedOutputs.save(widget);
};

current.context.pathChanged.connect(updateCloned);
current.content.model.cells.changed.connect(updateCloned);
current.context.model.cells.changed.connect(updateCloned);

// Add the cloned output to the output widget tracker.
void clonedOutputs.add(widget);

// Remove the output view if the parent notebook is closed.
current.content.disposed.connect(() => {
current.context.pathChanged.disconnect(updateCloned);
current.content.model.cells.changed.disconnect(updateCloned);
current.context.model.cells.changed.disconnect(updateCloned);
widget.dispose();
});
},
Expand Down