diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Models/ExtensionService.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Models/ExtensionService.cs index 232f35c3fa..576ea08140 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Models/ExtensionService.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Models/ExtensionService.cs @@ -131,6 +131,7 @@ public class ExtensionService : IExtensionService, IDisposable try { _installedExtensions.RemoveAll(i => removedExtensions.Contains(i)); + _enabledExtensions.RemoveAll(i => removedExtensions.Contains(i)); OnExtensionRemoved?.Invoke(this, removedExtensions); } diff --git a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/TopLevelCommandManager.cs b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/TopLevelCommandManager.cs index 1274b8800f..2b95445185 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/TopLevelCommandManager.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/TopLevelCommandManager.cs @@ -133,16 +133,11 @@ public partial class TopLevelCommandManager : ObservableObject, var wrapper = clone[i]; try { - // TODO! this can be safer, we're not directly exposing ICommandItem's out of CPW anymore - var thisCommand = wrapper.ItemViewModel.Model.Unsafe; - if (thisCommand != null) + var isTheSame = wrapper == firstCommand; + if (isTheSame) { - var isTheSame = thisCommand == firstCommand; - if (isTheSame) - { - startIndex = i; - break; - } + startIndex = i; + break; } } catch