Watch for on load event (#12309)

This commit is contained in:
Chris LaFreniere
2020-09-15 23:27:05 -07:00
committed by GitHub
parent 7e76f8cb20
commit ffb81d88fd
3 changed files with 12 additions and 1 deletions

View File

@@ -322,7 +322,7 @@ export class NotebookModel extends Disposable implements INotebookModel {
return !ids ? [] : ids;
}
public async loadContents(isTrusted: boolean = false): Promise<void> {
public async loadContents(isTrusted = false, forceLayoutChange = false): Promise<void> {
try {
this._trustedMode = isTrusted;
@@ -369,6 +369,9 @@ export class NotebookModel extends Disposable implements INotebookModel {
if (this._cells.length === 0 || this._cells.every(cell => cell.cellType === CellTypes.Markdown)) {
this.trustedMode = true;
}
if (forceLayoutChange) {
this._layoutChanged.fire();
}
} catch (error) {
this._inErrorState = true;
throw error;