Skip to content

Commit

Permalink
Don't indicate dirty when trust changes (microsoft#12758)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyceerhl committed Jul 7, 2020
1 parent e5e5417 commit ed125d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/client/datascience/notebookStorage/baseModel.ts
Expand Up @@ -102,11 +102,16 @@ export abstract class BaseNotebookModel implements INotebookModel {
}

// Forward onto our listeners if necessary
if (changed || this.isDirty !== oldDirty) {
if ((changed || this.isDirty !== oldDirty) && change.kind !== 'updateTrust') {
this._changedEmitter.fire({ ...change, newDirty: this.isDirty, oldDirty, model: this });
}
// Slightly different for the event we send to VS code. Skip version and file changes. Only send user events.
if ((changed || this.isDirty !== oldDirty) && change.kind !== 'version' && change.source === 'user') {
if (
(changed || this.isDirty !== oldDirty) &&
change.kind !== 'version' &&
change.source === 'user' &&
change.kind !== 'updateTrust'
) {
this._editEventEmitter.fire(change);
}
}
Expand Down

0 comments on commit ed125d5

Please sign in to comment.