@@ -76,7 +76,7 @@ export default extension;
76
76
function activate (
77
77
app : JupyterFrontEnd ,
78
78
browserFactory : IFileBrowserFactory ,
79
- restorer : ILayoutRestorer ,
79
+ restorer : ILayoutRestorer | null ,
80
80
menu : IMainMenu ,
81
81
palette : ICommandPalette ,
82
82
launcher : ILauncher | null
@@ -87,12 +87,14 @@ function activate(
87
87
const tracker = new WidgetTracker < DrawIODocumentWidget > ( { namespace } ) ;
88
88
89
89
// Handle state restoration.
90
- restorer . restore ( tracker , {
91
- command : 'docmanager:open' ,
92
- args : widget => ( { path : widget . context . path , factory : FACTORY } ) ,
93
- name : widget => widget . context . path
94
- } ) ;
95
-
90
+ if ( restorer ) {
91
+ restorer . restore ( tracker , {
92
+ command : 'docmanager:open' ,
93
+ args : widget => ( { path : widget . context . path , factory : FACTORY } ) ,
94
+ name : widget => widget . context . path
95
+ } ) ;
96
+ }
97
+
96
98
const widgetFactory = new DrawIOWidgetFactory ( {
97
99
name : FACTORY ,
98
100
modelName : 'dio' ,
@@ -119,7 +121,7 @@ function activate(
119
121
app . docRegistry . addFileType ( {
120
122
name : 'drawio' ,
121
123
displayName : 'Diagram' ,
122
- mimeTypes : [ 'application/dio ' , 'application/drawio' ] ,
124
+ mimeTypes : [ 'text/xml ' , 'application/drawio' , 'application/dio '] ,
123
125
extensions : [ '.dio' , '.drawio' ] ,
124
126
iconClass : 'jp-MaterialIcon jp-ImageIcon' ,
125
127
fileFormat : 'text' ,
0 commit comments