Skip to content

Commit ff1c2c3

Browse files
committed
remove unused import
1 parent b73046c commit ff1c2c3

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

packages/tree-extension/src/index.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import { Menu, MenuBar } from '@lumino/widgets';
4747
import { NotebookTreeWidget, INotebookTree } from '@jupyter-notebook/tree';
4848

4949
import { FilesActionButtons } from './fileactions';
50-
import { INotebookShell } from '@jupyter-notebook/application';
5150

5251
/**
5352
* The file browser factory.
@@ -266,7 +265,6 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
266265
ISettingRegistry,
267266
IToolbarWidgetRegistry,
268267
IFileBrowserFactory,
269-
INotebookShell,
270268
],
271269
optional: [
272270
IRunningSessionManagers,
@@ -282,7 +280,6 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
282280
settingRegistry: ISettingRegistry,
283281
toolbarRegistry: IToolbarWidgetRegistry,
284282
factory: IFileBrowserFactory,
285-
notebookShell: INotebookShell,
286283
manager: IRunningSessionManagers | null,
287284
settingEditorTracker: ISettingEditorTracker | null,
288285
jsonSettingEditorTracker: IJSONSettingEditorTracker | null
@@ -388,17 +385,25 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
388385
}
389386
);
390387

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) => {
394389
if (widget.model.driveName) {
395-
const parent = widget.parent;
390+
// const parent = widget.parent;
396391
widget.parent = null;
397392
nbTreeWidget.addWidget(widget);
398393
widget.title.label = widget.model.driveName;
399394
nbTreeWidget.tabBar.addTab(widget.title);
400-
parent?.dispose();
395+
// parent?.dispose();
401396
}
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();
402407
});
403408

404409
// TODO: remove
@@ -408,8 +413,9 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
408413
tracker['_pool'].current = browser;
409414
};
410415

411-
tracker.widgetAdded.connect(setCurrentToDefaultBrower);
412-
setCurrentToDefaultBrower();
416+
tracker.widgetAdded.connect((sender, widget) =>
417+
setCurrentToDefaultBrower()
418+
);
413419

414420
return nbTreeWidget;
415421
},

0 commit comments

Comments
 (0)