Skip to content

Commit

Permalink
one more try
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Oct 14, 2024
1 parent b6286ff commit 19b06ed
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions packages/tree-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,29 +384,31 @@ const notebookTreeWidget: JupyterFrontEndPlugin<INotebookTree> = {
// See https://github.com/jupyterlab/jupyterlab/issues/15629 for more info
const setCurrentToDefaultBrower = () => {
tracker['_pool'].current = browser;

// TODO: remove?
// provide some default state so the file browser widths are consistent and predictable
setTimeout(() => {
stateDB
.save('file-browser-filebrowser:columns', {
sizes: {
name: 738.65625,
file_size: 109.95727378063403,
is_selected: 18,
last_modified: 406.5739762193659,
},
})
.then(async () => {
await browser['listing'].restore('filebrowser');
});
});
};

tracker.widgetAdded.connect((sender, widget) =>
setCurrentToDefaultBrower()
);
tracker.widgetAdded.connect((sender, widget) => {
setCurrentToDefaultBrower();
});

setCurrentToDefaultBrower();

// TODO: remove?
// provide some default state so the file browser widths are consistent and predictable
stateDB
.save('file-browser-filebrowser:columns', {
sizes: {
name: 496.953125,
file_size: 274.16145833333394,
is_selected: 28,
last_modified: 474.072916666666,
},
})
.then(async () => {
await browser['listing'].restore('filebrowser');
});

return nbTreeWidget;
},
};
Expand Down

0 comments on commit 19b06ed

Please sign in to comment.