Wait for settings before opening the notebook

pull/6294/head
Jeremy Tuloup 4 years ago
parent fcab58cef5
commit 4eca86cbcd

@ -159,10 +159,12 @@ const opener: JupyterFrontEndPlugin<void> = {
id: '@retrolab/application-extension:opener',
autoStart: true,
requires: [IRouter, IDocumentManager],
optional: [ISettingRegistry],
activate: (
app: JupyterFrontEnd,
router: IRouter,
docManager: IDocumentManager
docManager: IDocumentManager,
settingRegistry: ISettingRegistry | null
): void => {
const { commands } = app;
@ -178,9 +180,12 @@ const opener: JupyterFrontEndPlugin<void> = {
const file = decodeURIComponent(path);
const ext = PathExt.extname(file);
app.restored.then(() => {
app.restored.then(async () => {
// TODO: get factory from file type instead?
if (ext === '.ipynb') {
// TODO: fix upstream?
await settingRegistry?.load('@jupyterlab/notebook-extension:panel');
await Promise.resolve();
docManager.open(file, NOTEBOOK_FACTORY, undefined, {
ref: '_noref'
});

Loading…
Cancel
Save