From 35385ffdd02337099d46bba736daa9b41d4ae99f Mon Sep 17 00:00:00 2001 From: Remco Epicnabbo Date: Fri, 15 May 2026 13:55:56 +0200 Subject: [PATCH] Simplify offer selection and activation logic Always call applySelectedOffer(offer) and consolidate activation into a single conditional. Removed the separate non-lazy branch and now only call offer.activate() when offer.isLazy && offer.offerId > -1, reducing duplicated logic and simplifying the flow. --- src/hooks/catalog/useCatalog.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hooks/catalog/useCatalog.ts b/src/hooks/catalog/useCatalog.ts index 09820ad..188aa89 100644 --- a/src/hooks/catalog/useCatalog.ts +++ b/src/hooks/catalog/useCatalog.ts @@ -540,16 +540,9 @@ const useCatalogState = () => { if(!offer) return; - if(!offer.isLazy) - { - applySelectedOffer(offer); - return; - } + applySelectedOffer(offer); - if(offer.offerId > -1) - { - offer.activate(); - } + if(offer.isLazy && (offer.offerId > -1)) offer.activate(); }, [ applySelectedOffer ]); const refreshBuilderStatus = useCallback(() =>