Browse Source

Make cell widget id unique using a uuid

Jason Grout 7 years ago
parent
commit
5ef39606d6
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/notebook-extension/src/index.ts

+ 2 - 2
packages/notebook-extension/src/index.ts

@@ -14,7 +14,7 @@ import {
 } from '@jupyterlab/codeeditor';
 
 import {
-  IStateDB, PageConfig, URLExt
+  IStateDB, PageConfig, URLExt, uuid
 } from '@jupyterlab/coreutils';
 
 import {
@@ -1021,7 +1021,7 @@ function addCommands(app: JupyterLab, services: ServiceManager, tracker: Noteboo
       const newCell = nb.activeCell.clone();
 
       let p = new Panel();
-      p.id = `Cell-${Math.random()}`;
+      p.id = `Cell-${uuid()}`;
       p.title.closable = true;
       if (current.title.label) {
         p.title.label = `Cell (${current.title.label})`;