File tree 1 file changed +8
-2
lines changed
packages/lab-extension/src
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> = {
69
69
id : '@jupyter-notebook/lab-extension:interface-switcher' ,
70
70
description : 'A plugin to add custom toolbar items to the notebook page.' ,
71
71
autoStart : true ,
72
- requires : [ ITranslator , INotebookTracker ] ,
72
+ requires : [ ITranslator ] ,
73
73
optional : [
74
+ INotebookTracker ,
74
75
ICommandPalette ,
75
76
INotebookPathOpener ,
76
77
INotebookShell ,
@@ -80,13 +81,18 @@ const interfaceSwitcher: JupyterFrontEndPlugin<void> = {
80
81
activate : (
81
82
app : JupyterFrontEnd ,
82
83
translator : ITranslator ,
83
- notebookTracker : INotebookTracker ,
84
+ notebookTracker : INotebookTracker | null ,
84
85
palette : ICommandPalette | null ,
85
86
notebookPathOpener : INotebookPathOpener | null ,
86
87
notebookShell : INotebookShell | null ,
87
88
labShell : ILabShell | null ,
88
89
toolbarRegistry : IToolbarWidgetRegistry | null
89
90
) => {
91
+ if ( ! notebookTracker ) {
92
+ // bail if trying to use this plugin without a notebook tracker
93
+ return ;
94
+ }
95
+
90
96
const { commands, shell } = app ;
91
97
const baseUrl = PageConfig . getBaseUrl ( ) ;
92
98
const trans = translator . load ( 'notebook' ) ;
You can’t perform that action at this time.
0 commit comments