File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
packages/lab-extension/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,9 @@ const interfaceSwitcher: JupyterFrontEndPlugin<void> = {
6969 id : '@jupyter-notebook/lab-extension:interface-switcher' ,
7070 description : 'A plugin to add custom toolbar items to the notebook page.' ,
7171 autoStart : true ,
72- requires : [ ITranslator , INotebookTracker ] ,
72+ requires : [ ITranslator ] ,
7373 optional : [
74+ INotebookTracker ,
7475 ICommandPalette ,
7576 INotebookPathOpener ,
7677 INotebookShell ,
@@ -80,13 +81,18 @@ const interfaceSwitcher: JupyterFrontEndPlugin<void> = {
8081 activate : (
8182 app : JupyterFrontEnd ,
8283 translator : ITranslator ,
83- notebookTracker : INotebookTracker ,
84+ notebookTracker : INotebookTracker | null ,
8485 palette : ICommandPalette | null ,
8586 notebookPathOpener : INotebookPathOpener | null ,
8687 notebookShell : INotebookShell | null ,
8788 labShell : ILabShell | null ,
8889 toolbarRegistry : IToolbarWidgetRegistry | null
8990 ) => {
91+ if ( ! notebookTracker ) {
92+ // bail if trying to use this plugin without a notebook tracker
93+ return ;
94+ }
95+
9096 const { commands, shell } = app ;
9197 const baseUrl = PageConfig . getBaseUrl ( ) ;
9298 const trans = translator . load ( 'notebook' ) ;
You can’t perform that action at this time.
0 commit comments