Skip to content

Commit

Permalink
Fixes per review
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Udoff committed Nov 27, 2019
1 parent 25bb8e7 commit aabb6af
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/notebook/src/actions.tsx
Expand Up @@ -1301,12 +1301,10 @@ export namespace NotebookActions {
let latestCellIdx: number = null;
notebook.widgets.forEach((cell, cellIndx) => {
if (cell.model.type === 'code') {
const execution = (cell as CodeCell).model.metadata.get('execution');
if (
execution &&
typeof execution === 'object' &&
'iopub.status.busy' in execution
) {
const execution = (cell as CodeCell).model.metadata.get(
'execution'
) as JSONObject;
if (execution && execution['iopub.status.busy'] !== undefined) {
// The busy status is used as soon as a request is received:
// https://jupyter-client.readthedocs.io/en/stable/messaging.html
const timestamp = execution['iopub.status.busy'].toString();
Expand All @@ -1320,7 +1318,7 @@ export namespace NotebookActions {
}
}
});
if (latestCellIdx) {
if (latestCellIdx !== null) {
notebook.activeCellIndex = latestCellIdx;
}
}
Expand Down

0 comments on commit aabb6af

Please sign in to comment.