From f7248e1f8a0077db575e94d076786067411f401c Mon Sep 17 00:00:00 2001 From: haven1433 Date: Sat, 12 Aug 2023 20:12:03 -0500 Subject: [PATCH] fix broken save logic --- src/HexManiac.Core/Models/ModelDelta.cs | 1 - src/HexManiac.Core/ViewModels/ChangeHistory.cs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HexManiac.Core/Models/ModelDelta.cs b/src/HexManiac.Core/Models/ModelDelta.cs index ca5e1ca2..cb4a9ac8 100644 --- a/src/HexManiac.Core/Models/ModelDelta.cs +++ b/src/HexManiac.Core/Models/ModelDelta.cs @@ -241,7 +241,6 @@ namespace HavenSoft.HexManiac.Core.Models { } private IDisposable CaptureNonDataChange() { - var initialState = HasAnyChange; if (HasAnyChange) return new StubDisposable(); return new StubDisposable { Dispose = () => { if (!HasAnyChange) return; diff --git a/src/HexManiac.Core/ViewModels/ChangeHistory.cs b/src/HexManiac.Core/ViewModels/ChangeHistory.cs index d807de17..1b3dc860 100644 --- a/src/HexManiac.Core/ViewModels/ChangeHistory.cs +++ b/src/HexManiac.Core/ViewModels/ChangeHistory.cs @@ -160,8 +160,9 @@ namespace HavenSoft.HexManiac.Core.ViewModels { var hasDataChange = HasDataChange; if (hasDataChange != hasDataChangeCache) { hasDataChangeCache = hasDataChange; - NotifyPropertyChanged(nameof(HasDataChange)); + NotifyPropertyChanged(nameof(HasDataChange), nameof(IsSaved)); } + if (!hasDataChange && currentChange.HasAnyChange) NotifyPropertyChanged(nameof(IsSaved)); } private void UndoExecuted() {