Skip to content

Commit

Permalink
Try fix default viewers overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Jun 19, 2023
1 parent 245c3e9 commit c7fc3d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/application-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ const opener: JupyterFrontEndPlugin<void> = {
router: IRouter,
docManager: IDocumentManager
): void => {
const { commands } = app;
const { commands, docRegistry } = app;

const command = 'router:tree';
commands.addCommand(command, {
Expand All @@ -195,10 +195,11 @@ const opener: JupyterFrontEndPlugin<void> = {
return;
}

const file = decodeURIComponent(path);
const urlParams = new URLSearchParams(parsed.search);
const factory = urlParams.get('factory') ?? 'default';
app.started.then(async () => {
const file = decodeURIComponent(path);
const urlParams = new URLSearchParams(parsed.search);
const defaultFactory = docRegistry.defaultWidgetFactory(path);
const factory = urlParams.get('factory') ?? defaultFactory.name;
docManager.open(file, factory, undefined, {
ref: '_noref',
});
Expand Down

0 comments on commit c7fc3d2

Please sign in to comment.