fix: update hasUnsavedChanges logic for draft versions and improve visualization spec handling

This commit is contained in:
2025-01-19 14:12:54 +02:00
parent 2664b12c12
commit 86058767a1
2 changed files with 9 additions and 5 deletions

View File

@@ -43,10 +43,11 @@ export class SnippetManager {
snippet.content;
this.editorManager.setValue(content);
this.hasUnsavedChanges = false;
// Set hasUnsavedChanges to true if we're viewing a draft version
this.hasUnsavedChanges = this.isDraftVersion;
this.updateReadOnlyState();
this.uiManager.updateSaveButton(this.hasUnsavedChanges);
this.uiManager.updateVersionSwitch(this.currentSnippetId, this.isDraftVersion, this.hasDraftChanges(this.currentSnippetId));
this.uiManager.updateVersionSwitch(this.currentSnippetId, this.isDraftVersion, hasChanges);
this.uiManager.renderSnippetList(this.snippets, this.currentSnippetId);
this.visualizationManager.updateVisualization(content);
}