@@ -47,7 +47,6 @@ import { Menu, MenuBar } from '@lumino/widgets';
47
47
import { NotebookTreeWidget , INotebookTree } from '@jupyter-notebook/tree' ;
48
48
49
49
import { FilesActionButtons } from './fileactions' ;
50
- import { INotebookShell } from '@jupyter-notebook/application' ;
51
50
52
51
/**
53
52
* The file browser factory.
@@ -266,7 +265,6 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
266
265
ISettingRegistry ,
267
266
IToolbarWidgetRegistry ,
268
267
IFileBrowserFactory ,
269
- INotebookShell ,
270
268
] ,
271
269
optional : [
272
270
IRunningSessionManagers ,
@@ -282,7 +280,6 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
282
280
settingRegistry : ISettingRegistry ,
283
281
toolbarRegistry : IToolbarWidgetRegistry ,
284
282
factory : IFileBrowserFactory ,
285
- notebookShell : INotebookShell ,
286
283
manager : IRunningSessionManagers | null ,
287
284
settingEditorTracker : ISettingEditorTracker | null ,
288
285
jsonSettingEditorTracker : IJSONSettingEditorTracker | null
@@ -388,17 +385,25 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
388
385
}
389
386
) ;
390
387
391
- // add drives to the notebook tree widget
392
- tracker . forEach ( ( widget ) => {
393
- // move the additional drives to the notebook tree widget
388
+ const moveDrive = ( widget : FileBrowser ) => {
394
389
if ( widget . model . driveName ) {
395
- const parent = widget . parent ;
390
+ // const parent = widget.parent;
396
391
widget . parent = null ;
397
392
nbTreeWidget . addWidget ( widget ) ;
398
393
widget . title . label = widget . model . driveName ;
399
394
nbTreeWidget . tabBar . addTab ( widget . title ) ;
400
- parent ?. dispose ( ) ;
395
+ // parent?.dispose();
401
396
}
397
+ } ;
398
+
399
+ requestAnimationFrame ( ( ) => {
400
+ // add drives to the notebook tree widget
401
+ tracker . forEach ( ( widget ) => {
402
+ // move the additional drives to the notebook tree widget
403
+ moveDrive ( widget ) ;
404
+ } ) ;
405
+
406
+ setCurrentToDefaultBrower ( ) ;
402
407
} ) ;
403
408
404
409
// TODO: remove
@@ -408,8 +413,9 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
408
413
tracker [ '_pool' ] . current = browser ;
409
414
} ;
410
415
411
- tracker . widgetAdded . connect ( setCurrentToDefaultBrower ) ;
412
- setCurrentToDefaultBrower ( ) ;
416
+ tracker . widgetAdded . connect ( ( sender , widget ) =>
417
+ setCurrentToDefaultBrower ( )
418
+ ) ;
413
419
414
420
return nbTreeWidget ;
415
421
} ,
0 commit comments