mirror of
https://github.com/jupyter/notebook.git
synced 2025-04-24 14:20:54 +08:00
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:
parent
2a9e90325c
commit
7b329b4269
@ -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 |
Loading…
x
Reference in New Issue
Block a user