Browse Source

Fix bug in count when closing last document

Jessica Xu 4 years ago
parent
commit
029c993389
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/apputils-extension/src/index.ts

+ 3 - 1
packages/apputils-extension/src/index.ts

@@ -312,7 +312,9 @@ async function updateTabTitle(
   current = current.split(':')[1];
   if (workspace.startsWith('auto-')) {
     const count: number = Object.keys(data).length - 1;
-    document.title = `${current} (${workspace}:${count}) - JupyterLab`;
+    document.title = `${
+      count > 0 ? `${current} (${workspace}:${count}) -` : ''
+    } JupyterLab`;
   } else {
     document.title = `${current} - JupyterLab`;
   }