From a47b1d30e5a32c435c4a3cd149e5e20edd022dd8 Mon Sep 17 00:00:00 2001 From: stackedsax Date: Wed, 27 May 2026 13:47:51 -0700 Subject: [PATCH] Fix 'Add to Stack' showing for technologies already in the stack isAlreadyAdded was only checking the currently selected stage, so clicking a technology from the canvas (where no stage is selected in the panel) always showed the Add button even if the tech was already in the stack. Now checks across all stages. Co-Authored-By: Claude Sonnet 4.6 --- src/app/page.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 27c713d..ca1d509 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -176,10 +176,11 @@ export default function Home() { setSelectedTechnology(null) }, [selectedTechnology, selectedStage, handleRemoveTechnology]) - const isAlreadyAdded = - selectedTechnology && selectedStage - ? currentStack.technologies[selectedStage].some(t => t.id === selectedTechnology.id) - : false + const isAlreadyAdded = selectedTechnology + ? Object.values(currentStack.technologies) + .flat() + .some(t => t.id === selectedTechnology.id) + : false return (