File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -214,17 +214,15 @@ export class WidgetModel extends Backbone.Model {
214214 /**
215215 * Close model
216216 *
217- * @param comm_closed - true if the comm is already being closed. If false, the comm will be closed.
218- *
219217 * @returns - a promise that is fulfilled when all the associated views have been removed.
220218 */
221- close ( comm_closed = false ) : Promise < void > {
219+ close ( ) : Promise < void > {
222220 // can only be closed once.
223221 if ( this . _closed ) {
224222 return Promise . resolve ( ) ;
225223 }
226224 this . _closed = true ;
227- if ( this . comm && ! comm_closed ) {
225+ if ( this . comm && this . comm_live ) {
228226 this . comm . close ( ) ;
229227 }
230228 this . stopListening ( ) ;
@@ -249,8 +247,11 @@ export class WidgetModel extends Backbone.Model {
249247 * Handle when a widget comm is closed.
250248 */
251249 _handle_comm_closed ( msg : KernelMessage . ICommCloseMsg ) : void {
250+ this . comm_live = false ;
251+ if ( this . _closed ) {
252+ this . close ( ) ;
253+ }
252254 this . trigger ( 'comm:close' ) ;
253- this . close ( true ) ;
254255 }
255256
256257 /**
You can’t perform that action at this time.
0 commit comments