From db9d7a880403c1f9eba3393c702ce113e4a7256a Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Mon, 28 Jul 2025 18:42:55 -0500 Subject: [PATCH] CmdPal: fix handling form submits (#40847) Yea this was real dumb. I removed the `HandleCommandResultMessage` handler from `ShellPage`, and never put it on `ShellViewModel`. Just first-grade kind of mistake. Closes #40776 Regressed in #40479 re: #40113 --- .../Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs index 170103b09c..3663190f11 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ShellViewModel.cs @@ -13,7 +13,8 @@ using Microsoft.CommandPalette.Extensions; namespace Microsoft.CmdPal.Core.ViewModels; public partial class ShellViewModel : ObservableObject, - IRecipient + IRecipient, + IRecipient { private readonly IRootPageService _rootPageService; private readonly IAppHostService _appHostService; @@ -77,6 +78,7 @@ public partial class ShellViewModel : ObservableObject, // Register to receive messages WeakReferenceMessenger.Default.Register(this); + WeakReferenceMessenger.Default.Register(this); } [RelayCommand] @@ -358,6 +360,11 @@ public partial class ShellViewModel : ObservableObject, WeakReferenceMessenger.Default.Send(new(withAnimation, focusSearch)); } + public void Receive(HandleCommandResultMessage message) + { + UnsafeHandleCommandResult(message.Result.Unsafe); + } + private void OnUIThread(Action action) { _ = Task.Factory.StartNew(