Procházet zdrojové kódy

Make MainAreaWidget promise resolve *after* the spinner is removed.

This lets documents take action on the initial show of a document.
Jason Grout před 7 roky
rodič
revize
99c6c45462
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      packages/apputils/src/mainareawidget.ts

+ 2 - 2
packages/apputils/src/mainareawidget.ts

@@ -71,8 +71,7 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
       layout.addWidget(spinner);
       // Make sure the ready promise is a Promise<void> to avoid leaking any
       // results.
-      this._ready = options.ready.then(() => undefined);
-      this.ready.then(() => {
+      this._ready = options.ready.then(() => {
         this._isReady = true;
         const active = document.activeElement === spinner.node;
         spinner.dispose();
@@ -90,6 +89,7 @@ class MainAreaWidget<T extends Widget = Widget> extends Widget {
         BoxLayout.setStretch(error, 1);
         spinner.dispose();
         layout.addWidget(error);
+        throw(error);
       });
     // Handle no populated promise.
     } else {