From 81787b095ff9310701fbbdb501e5e3f58f40e938 Mon Sep 17 00:00:00 2001 From: ahmedmgamal94 <98055904+ahmedmgamal94@users.noreply.github.com> Date: Sun, 25 Aug 2024 00:24:46 -0700 Subject: [PATCH] dynamic fragment slots depending on aspect --- src/features/subclass/AbilitiesModification.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/features/subclass/AbilitiesModification.tsx b/src/features/subclass/AbilitiesModification.tsx index 50d4e42..9d8d15a 100644 --- a/src/features/subclass/AbilitiesModification.tsx +++ b/src/features/subclass/AbilitiesModification.tsx @@ -276,7 +276,6 @@ const AbilitiesModification: React.FC = ({ subclass updatedMods[index!] = mod as (typeof updatedMods)[number]; - // If updating aspects, we need to check if we need to empty any fragment slots if (category === 'ASPECTS') { const newAspects = updatedMods as ManifestAspect[]; const newAvailableSlots = newAspects.reduce( @@ -284,12 +283,10 @@ const AbilitiesModification: React.FC = ({ subclass 0 ); - // Update fragments, emptying any that exceed the new available slots const updatedFragments = loadout.fragments.map((fragment, idx) => idx < newAvailableSlots ? fragment : EMPTY_FRAGMENT ); - // Dispatch updates for both aspects and fragments dispatch( updateSubclassMods({ category: 'ASPECTS', @@ -302,11 +299,10 @@ const AbilitiesModification: React.FC = ({ subclass mods: updatedFragments, }) ); - return; // Exit the function early as we've already dispatched the updates + return; } } - // For all other cases, dispatch the update as before dispatch( updateSubclassMods({ category,