Clear cell execution count when clearing output. (#8908)

This commit is contained in:
Cory Rivera
2020-01-21 13:56:38 -08:00
committed by GitHub
parent d517cf0c8c
commit 52e3c2f9c7
3 changed files with 18 additions and 16 deletions

View File

@@ -418,6 +418,8 @@ export class CellModel implements ICellModel {
public clearOutputs(): void {
this._outputs = [];
this.fireOutputsChanged();
this.executionCount = undefined;
}
private fireOutputsChanged(shouldScroll: boolean = false): void {
@@ -584,7 +586,7 @@ export class CellModel implements ICellModel {
cellJson.metadata.language = this._language;
cellJson.metadata.tags = metadata.tags;
cellJson.outputs = this._outputs;
cellJson.execution_count = this.executionCount ? this.executionCount : 0;
cellJson.execution_count = this.executionCount ? this.executionCount : null;
}
return cellJson as nb.ICellContents;
}