Skip to content

Commit

Permalink
fix: restoring widgets from saved state is broken since v8
Browse files Browse the repository at this point in the history
In 9d999d7 waiting for sessionContext.ready was removed, this
caused _loadNotebook() not to work, because it was called before the
widget metadata was available.

This commit restores waiting for sessionContext.ready. This has
to be before _loadFromKernel(), otherwise this.kernel is not
present, causing an exeption, skipping _loadNotebook().

Fixes: jupyterlab/jupyterlab#15361
  • Loading branch information
mariobuikhuizen authored and martinRenou committed Jan 18, 2024
1 parent b253179 commit c52b230
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/jupyterlab_widgets/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export class WidgetManager extends LabWidgetManager {
{ loadKernel, loadNotebook } = { loadKernel: true, loadNotebook: true }
): Promise<void> {
try {
await this.context.sessionContext.ready;
if (loadKernel) {
try {
this._kernelRestoreInProgress = true;
Expand Down

0 comments on commit c52b230

Please sign in to comment.