From caececfc2fdbbff06b32184befbfbaeb717f26ef Mon Sep 17 00:00:00 2001 From: haven1433 Date: Wed, 1 Feb 2023 22:10:52 -0600 Subject: [PATCH] dispatch undo refresh needs to happen on the foreground thread, doesn't need to happen right away --- src/HexManiac.Core/ViewModels/EditorViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HexManiac.Core/ViewModels/EditorViewModel.cs b/src/HexManiac.Core/ViewModels/EditorViewModel.cs index cad57827..7c089818 100644 --- a/src/HexManiac.Core/ViewModels/EditorViewModel.cs +++ b/src/HexManiac.Core/ViewModels/EditorViewModel.cs @@ -530,7 +530,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels { { tab => tab.SaveAs, (sender, e) => saveAs.CanExecuteChanged.Invoke(this, e) }, { tab => tab.ExportBackup, (sender, e) => exportBackup.CanExecuteChanged.Invoke(this, e) }, { tab => tab.Close, (sender, e) => close.CanExecuteChanged.Invoke(this, e) }, - { tab => tab.Undo, (sender, e) => undo.CanExecuteChanged.Invoke(this, e) }, + { tab => tab.Undo, (sender, e) => workDispatcher.DispatchWork(() => undo.CanExecuteChanged.Invoke(this, e)) }, // refreshing undo from the background thread isn't allowed { tab => tab.Redo, (sender, e) => redo.CanExecuteChanged.Invoke(this, e) }, { tab => tab.Back, (sender, e) => back.CanExecuteChanged.Invoke(this, e) }, { tab => tab.Forward, (sender, e) => forward.CanExecuteChanged.Invoke(this, e) },