Skip to content

Commit

Permalink
Simplified ViewModel toggling
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Nov 4, 2024
1 parent b994f2e commit 9d16531
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ protected internal bool TryOrderByLoadOrderTW(IEnumerable<string> loadOrder, Fun
// Toggle IsSelected
foreach (var moduleVM in existingOrderedViewModels)
{
if (isModuleSelected(moduleVM.ModuleInfoExtended.Id) && !moduleVM.IsSelected)
SortHelper.ToggleModuleSelection(existingOrderedViewModels, moduleViewModelLookup, moduleVM);
if (!isModuleSelected(moduleVM.ModuleInfoExtended.Id) && moduleVM.IsSelected)
if (isModuleSelected(moduleVM.ModuleInfoExtended.Id) != moduleVM.IsSelected)
SortHelper.ToggleModuleSelection(existingOrderedViewModels, moduleViewModelLookup, moduleVM);
}

Expand Down Expand Up @@ -163,9 +161,7 @@ protected internal bool TryOrderByLoadOrderBeta(IEnumerable<string> loadOrder, F
// Toggle IsSelected
foreach (var moduleVM in existingOrderedViewModels)
{
if (isModuleSelected(moduleVM.ModuleInfoExtended.Id) && !moduleVM.IsSelected)
SortHelper.ToggleModuleSelection(existingOrderedViewModels, moduleViewModelLookup, moduleVM);
if (!isModuleSelected(moduleVM.ModuleInfoExtended.Id) && moduleVM.IsSelected)
if (isModuleSelected(moduleVM.ModuleInfoExtended.Id) != moduleVM.IsSelected)
SortHelper.ToggleModuleSelection(existingOrderedViewModels, moduleViewModelLookup, moduleVM);
}

Expand Down

0 comments on commit 9d16531

Please sign in to comment.