Browse Source

Merge pull request #1332 from blink1073/load-main-first

Fix handling of state version and update lab example
Afshin Darian 8 years ago
parent
commit
974d96c793
2 changed files with 3 additions and 1 deletions
  1. 1 0
      examples/lab/index.js
  2. 2 1
      src/statedb/plugin.ts

+ 1 - 0
examples/lab/index.js

@@ -20,6 +20,7 @@ lab.registerPlugins([
   require('jupyterlab/lib/console/plugin').consoleTrackerProvider,
   require('jupyterlab/lib/console/codemirror/plugin').rendererProvider,
   require('jupyterlab/lib/docregistry/plugin').docRegistryProvider,
+  require('jupyterlab/lib/docmanager/plugin').docManagerProvider,
   require('jupyterlab/lib/editorwidget/plugin').editorHandlerProvider,
   require('jupyterlab/lib/faq/plugin').faqExtension,
   require('jupyterlab/lib/filebrowser/plugin').fileBrowserProvider,

+ 2 - 1
src/statedb/plugin.ts

@@ -40,7 +40,8 @@ const stateProvider: JupyterLabPlugin<IStateDB> = {
  */
 function activateState(app: JupyterLab, palette: ICommandPalette): Promise<IStateDB> {
   let state = new StateDB();
-  let version = (window as any).jupyter.version;
+  let jupyter = (window as any).jupyter;
+  let version = jupyter ? jupyter.version : 'unknown';
   let command = 'statedb:clear';
   let category = 'Help';
   let key = 'statedb:version';