소스 검색

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;