From 69e21b3e6e918009b5d7fdb2f86994448395642b Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 21 Nov 2022 12:29:01 -0500 Subject: [PATCH] Allow multiple badge packets --- src/hooks/inventory/useInventoryBadges.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/inventory/useInventoryBadges.ts b/src/hooks/inventory/useInventoryBadges.ts index e5d46620..80d775d0 100644 --- a/src/hooks/inventory/useInventoryBadges.ts +++ b/src/hooks/inventory/useInventoryBadges.ts @@ -66,8 +66,8 @@ const useInventoryBadgesState = () => for(const newBadgeCode of newBadgeCodes) newBadgeIds.push(parser.getBadgeId(newBadgeCode)); - setBadgeCodes(newBadgeCodes); - setBadgeIds(newBadgeIds); + setBadgeCodes(prevValue => [ ...prevValue, ...newBadgeCodes ]); + setBadgeIds(prevValue => [ ...prevValue, ...newBadgeIds ]); setActiveBadgeCodes(parser.getActiveBadgeCodes()); });