|
@@ -127,11 +127,11 @@ function activate(app: JupyterLab, manager: IServiceManager, documentManager: ID
|
|
|
};
|
|
|
|
|
|
// Restore the state of the file browser on reload.
|
|
|
- let key = `${NAMESPACE}:cwd`;
|
|
|
+ const key = `${NAMESPACE}:cwd`;
|
|
|
let connect = () => {
|
|
|
// Save the subsequent state of the file browser in the state database.
|
|
|
fbModel.pathChanged.connect((sender, args) => {
|
|
|
- state.save(`${NAMESPACE}:cwd`, { path: args.newValue });
|
|
|
+ state.save(key, { path: args.newValue });
|
|
|
});
|
|
|
};
|
|
|
Promise.all([state.fetch(key), app.started, manager.ready]).then(([cwd]) => {
|
|
@@ -140,10 +140,10 @@ function activate(app: JupyterLab, manager: IServiceManager, documentManager: ID
|
|
|
}
|
|
|
let path = cwd['path'] as string;
|
|
|
return manager.contents.get(path)
|
|
|
- .then(() => { fbModel.cd(path); })
|
|
|
- .catch(() => { state.remove(key); });
|
|
|
+ .then(() => fbModel.cd(path))
|
|
|
+ .catch(() => state.remove(key));
|
|
|
}).then(connect)
|
|
|
- .catch(() => { state.remove(key).then(connect); });
|
|
|
+ .catch(() => state.remove(key).then(connect));
|
|
|
|
|
|
each(registry.creators(), creator => { addCreator(creator.name); });
|
|
|
|