mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
Fix notebook dirty state after save (#6096)
Was getting a content changed loop in the events Fix is to ignore save events from the input since it sends them
This commit is contained in:
committed by
Chris LaFreniere
parent
d67fd038dc
commit
27cbd53253
@@ -93,6 +93,11 @@ export class NotebookEditorModel extends EditorModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public updateModel(contentChange?: NotebookContentChange): void {
|
public updateModel(contentChange?: NotebookContentChange): void {
|
||||||
|
if (contentChange && contentChange.changeType === NotebookChangeType.Saved) {
|
||||||
|
// We send the saved events out, so ignore. Otherwise we double-count this as a change
|
||||||
|
// and cause the text to be reapplied
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (contentChange && contentChange.changeType === NotebookChangeType.TrustChanged) {
|
if (contentChange && contentChange.changeType === NotebookChangeType.TrustChanged) {
|
||||||
// This is a serializable change (in that we permanently cache trusted state, but
|
// This is a serializable change (in that we permanently cache trusted state, but
|
||||||
// ironically isn't cached in the JSON contents since trust doesn't persist across machines.
|
// ironically isn't cached in the JSON contents since trust doesn't persist across machines.
|
||||||
@@ -115,7 +120,7 @@ export class NotebookEditorModel extends EditorModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private sendNotebookSerializationStateChange() {
|
private sendNotebookSerializationStateChange(): void {
|
||||||
let notebookModel = this.getNotebookModel();
|
let notebookModel = this.getNotebookModel();
|
||||||
if (notebookModel) {
|
if (notebookModel) {
|
||||||
this.notebookService.serializeNotebookStateChange(this.notebookUri, NotebookChangeType.Saved);
|
this.notebookService.serializeNotebookStateChange(this.notebookUri, NotebookChangeType.Saved);
|
||||||
|
|||||||
Reference in New Issue
Block a user