fix trusted status indication (#7036)

* 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 <jeremy.tuloup@gmail.com>
This commit is contained in:
adigaboy 2023-09-08 11:21:01 +03:00 committed by GitHub
parent 2a9e90325c
commit 7b329b4269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -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;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 22 KiB