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 {
214
214
/**
215
215
* Close model
216
216
*
217
- * @param comm_closed - true if the comm is already being closed. If false, the comm will be closed.
218
- *
219
217
* @returns - a promise that is fulfilled when all the associated views have been removed.
220
218
*/
221
- close ( comm_closed = false ) : Promise < void > {
219
+ close ( ) : Promise < void > {
222
220
// can only be closed once.
223
221
if ( this . _closed ) {
224
222
return Promise . resolve ( ) ;
225
223
}
226
224
this . _closed = true ;
227
- if ( this . comm && ! comm_closed ) {
225
+ if ( this . comm && this . comm_live ) {
228
226
this . comm . close ( ) ;
229
227
}
230
228
this . stopListening ( ) ;
@@ -249,8 +247,11 @@ export class WidgetModel extends Backbone.Model {
249
247
* Handle when a widget comm is closed.
250
248
*/
251
249
_handle_comm_closed ( msg : KernelMessage . ICommCloseMsg ) : void {
250
+ this . comm_live = false ;
251
+ if ( this . _closed ) {
252
+ this . close ( ) ;
253
+ }
252
254
this . trigger ( 'comm:close' ) ;
253
- this . close ( true ) ;
254
255
}
255
256
256
257
/**
You can’t perform that action at this time.
0 commit comments