Explorar o código

Shorten the logic slightly with optional chaining.

Jason Grout %!s(int64=5) %!d(string=hai) anos
pai
achega
9aecd5116f
Modificáronse 1 ficheiros con 1 adicións e 5 borrados
  1. 1 5
      packages/help-extension/src/index.tsx

+ 1 - 5
packages/help-extension/src/index.tsx

@@ -197,11 +197,7 @@ function activate(
       kernelConnectionOptions: { handleComms: false }
     });
 
-    const kernel = session.kernel;
-    if (!kernel) {
-      return;
-    }
-    void kernel.info.then(kernelInfo => {
+    void session.kernel?.info.then(kernelInfo => {
       const name = session.kernel!.name;
 
       // Check the cache second time so that, if two callbacks get scheduled,