Переглянути джерело

Add TODO for the requestAnimationFrame

Jeremy Tuloup 5 роки тому
батько
коміт
140cee3efd
1 змінених файлів з 6 додано та 4 видалено
  1. 6 4
      src/handlers/notebook.ts

+ 6 - 4
src/handlers/notebook.ts

@@ -54,11 +54,13 @@ export class NotebookHandler implements IDisposable {
     notebookTracker: NotebookTracker,
     codeCell: CodeCell
   ) {
-    if (notebookTracker.currentWidget.id === this.id) {
-      requestAnimationFrame(() => {
-        this.cellManager.activeCell = codeCell;
-      });
+    if (notebookTracker.currentWidget.id !== this.id) {
+      return;
     }
+    // TODO: do we need this requestAnimationFrame?
+    requestAnimationFrame(() => {
+      this.cellManager.activeCell = codeCell;
+    });
   }
 
   private notebookTracker: INotebookTracker;