From 1bf017f7b060510e524626c7f4eeef5716b13ded Mon Sep 17 00:00:00 2001 From: Sainan Date: Sat, 4 May 2024 20:56:01 +0200 Subject: [PATCH] feat: implement deleting of loadout configs --- src/services/saveLoadoutService.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/services/saveLoadoutService.ts b/src/services/saveLoadoutService.ts index 9319035a..826a8548 100644 --- a/src/services/saveLoadoutService.ts +++ b/src/services/saveLoadoutService.ts @@ -77,6 +77,11 @@ export const handleInventoryItemConfigChange = async ( // all non-empty entries are one loadout slot for (const [loadoutId, loadoutConfig] of Object.entries(newLoadout)) { + if (loadoutConfig.Remove) { + loadout[loadoutSlot].pull({ _id: loadoutId }); + continue; + } + const oldLoadoutConfig = loadout[loadoutSlot].find( loadout => loadout._id.toString() === loadoutId );