Enable loading spinner for notebook editor. (#18810)

This commit is contained in:
Cory Rivera
2022-03-24 16:31:33 -07:00
committed by GitHub
parent f325a2df08
commit d9501ffc03
5 changed files with 32 additions and 11 deletions

View File

@@ -78,7 +78,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
@Input() _views: NotebookViewsExtension;
protected _actionBar: Taskbar;
protected isLoading: boolean;
private _modelReadyDeferred = new Deferred<NotebookModel>();
private _trustedAction: TrustedAction;
private _runAllCellsAction: RunAllCellsAction;
@@ -112,7 +111,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
@Inject(IConfigurationService) private _configurationService: IConfigurationService
) {
super();
this.isLoading = true;
this.doubleClickEditEnabled = this._configurationService.getValue('notebook.enableDoubleClickEdit');
this._register(this._configurationService.onDidChangeConfiguration(e => {
this.previewFeaturesEnabled = this._configurationService.getValue('workbench.enablePreviewFeatures');
@@ -436,7 +434,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
}
} else {
this.setViewInErrorState(localize('displayFailed', "Could not display contents: {0}", getErrorMessage(error)));
this.setLoading(false);
this._modelReadyDeferred.reject(error);
this.notebookService.addNotebookEditor(this);
}
@@ -444,11 +441,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
}
}
private setLoading(isLoading: boolean): void {
this.isLoading = isLoading;
this.detectChanges();
}
private async registerModel(): Promise<void> {
this._register(this._model.onError((errInfo: INotification) => this.handleModelError(errInfo)));
this._register(this._model.contentChanged((change) => this.handleContentChanged(change)));
@@ -458,7 +450,6 @@ export class NotebookComponent extends AngularDisposable implements OnInit, OnDe
this._register(this._model.layoutChanged(() => this.detectChanges()));
this._register(this.model.onScroll.event(() => this._onScroll.fire()));
this.setLoading(false);
// Check if URI fragment is present; if it is, navigate to section by default
this.navigateToSectionIfURIFragmentExists();
this.updateToolbarComponents();