Browse Source

Fix debug commands showing up in release builds

Equbuxu 3 years ago
parent
commit
aef9913e5f

+ 3 - 3
PixiEditor/ViewModels/SubViewModels/Main/DebugViewModel.cs

@@ -13,7 +13,7 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
     {
         public bool IsDebugBuild { get; set; }
 
-        public bool IsDebugModeEnabaled { get; set; }
+        public bool IsDebugModeEnabled { get; set; }
 
         public bool UseDebug { get; set; }
 
@@ -66,6 +66,6 @@ namespace PixiEditor.ViewModels.SubViewModels.Main
         [Conditional("DEBUG")]
         private void SetDebug() => IsDebugBuild = true;
 
-        private void UpdateDebugMode(bool setting) => UseDebug = IsDebugBuild || IsDebugModeEnabaled;
+        private void UpdateDebugMode(bool setting) => UseDebug = IsDebugBuild || IsDebugModeEnabled;
     }
-}
+}

+ 1 - 0
PixiEditor/Views/UserControls/CommandSearch/CommandSearchControlHelper.cs

@@ -48,6 +48,7 @@ internal static class CommandSearchControlHelper
         newResults.AddRange(
             controller.Commands
                 .Where(x => x.Description.Contains(query, StringComparison.OrdinalIgnoreCase))
+                .Where(static x => ViewModelMain.Current.DebugSubViewModel.UseDebug ? true : !x.IsDebug)
                 .OrderByDescending(x => x.Description.Contains($" {query} ", StringComparison.OrdinalIgnoreCase))
                 .Take(12)
                 .Select(command => new CommandSearchResult(command)