Skip to content

Commit

Permalink
fix trusted status indication (#7036)
Browse files Browse the repository at this point in the history
* fix isTrusted with check cell type

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* camelCase and redundant ;

* Update Playwright Snapshots

* Update Playwright Snapshots

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Tuloup <[email protected]>
  • Loading branch information
4 people authored Sep 8, 2023
1 parent 2a9e903 commit 7b329b4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions packages/notebook-extension/src/trusted.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ const isTrusted = (notebook: Notebook): boolean => {
return false;
}
const cells = Array.from(model.cells);
let total = 0;
let trusted = 0;

const trusted = cells.reduce((accum, current) => {
if (current.trusted) {
return accum + 1;
} else {
return accum;
for (const currentCell of cells) {
if (currentCell.type !== 'code') {
continue;
}
}, 0);
total++;
if (currentCell.trusted) {
trusted++;
}
}

const total = cells.length;
return trusted === total;
};

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7b329b4

Please sign in to comment.