From f909bc3cf11a685c3fcec93cdbdd66e1bd0132d7 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Sun, 15 Dec 2019 13:50:02 +0100 Subject: [PATCH] Close output views on notebook closed --- packages/notebook-extension/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index 542991559be1..f92810219a49 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -1668,8 +1668,9 @@ 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); @@ -1677,7 +1678,7 @@ function addCommands( // 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(); }); },