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.
This commit is contained in:
Remco Epicnabbo
2026-05-15 13:55:56 +02:00
parent 123c2fca7b
commit 35385ffdd0
+2 -9
View File
@@ -540,16 +540,9 @@ const useCatalogState = () =>
{ {
if(!offer) return; if(!offer) return;
if(!offer.isLazy) applySelectedOffer(offer);
{
applySelectedOffer(offer);
return;
}
if(offer.offerId > -1) if(offer.isLazy && (offer.offerId > -1)) offer.activate();
{
offer.activate();
}
}, [ applySelectedOffer ]); }, [ applySelectedOffer ]);
const refreshBuilderStatus = useCallback(() => const refreshBuilderStatus = useCallback(() =>