File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
packages/jupyterlab-manager/src Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,10 @@ export class WidgetManager extends LabWidgetManager {
588
588
// Only restore if our initial restore at construction is finished
589
589
if ( this . _initialRestoredStatus ) {
590
590
// We only want to restore widgets from the kernel, not ones saved in the notebook.
591
- this . restoreWidgets ( this . _context ! . model ) ;
591
+ this . restoreWidgets ( this . _context ! . model , {
592
+ loadKernel : true ,
593
+ loadNotebook : false
594
+ } ) ;
592
595
}
593
596
}
594
597
}
@@ -602,9 +605,16 @@ export class WidgetManager extends LabWidgetManager {
602
605
/**
603
606
* Restore widgets from kernel and saved state.
604
607
*/
605
- async restoreWidgets ( notebook : INotebookModel ) : Promise < void > {
606
- await this . _loadFromKernel ( ) ;
607
- await this . _loadFromNotebook ( notebook ) ;
608
+ async restoreWidgets (
609
+ notebook : INotebookModel ,
610
+ { loadKernel, loadNotebook } = { loadKernel : true , loadNotebook : true }
611
+ ) : Promise < void > {
612
+ if ( loadKernel ) {
613
+ await this . _loadFromKernel ( ) ;
614
+ }
615
+ if ( loadNotebook ) {
616
+ await this . _loadFromNotebook ( notebook ) ;
617
+ }
608
618
this . _restoredStatus = true ;
609
619
this . _initialRestoredStatus = true ;
610
620
this . _restored . emit ( ) ;
You can’t perform that action at this time.
0 commit comments