Skip to content

Commit

Permalink
Remove a noisy console warn in the metadata form (jupyterlab#14483)
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin authored May 3, 2023
1 parent 19050c7 commit 0779b1a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/metadataform/src/metadataform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -335,19 +335,16 @@ export class MetadataFormWidget
/**
* Handle a change to the active cell metadata.
*/
protected onActiveCellMetadataChanged(msg: Message): void {
protected onActiveCellMetadataChanged(_: Message): void {
if (!this._updatingMetadata && this.isVisible) this._update();
}

protected onActiveNotebookPanelChanged(msg: Message): void {
// Do not use notebook metadata if model is null.
let notebook = this.notebookTools.activeNotebookPanel;
if (notebook === null || notebook.model === null) {
console.warn('Notebook model is null, its metadata cannot be updated.');
this._notebookModelNull = true;
} else {
this._notebookModelNull = false;
}
/**
* Handle when the active notebook panel changes.
*/
protected onActiveNotebookPanelChanged(_: Message): void {
const notebook = this.notebookTools.activeNotebookPanel;
this._notebookModelNull = notebook === null || notebook.model === null;
if (!this._updatingMetadata && this.isVisible) this._update();
}

Expand Down

0 comments on commit 0779b1a

Please sign in to comment.