From f7053dcf2f1c375e2269f078184457cda007eeec Mon Sep 17 00:00:00 2001 From: Hikari Date: Mon, 9 Mar 2026 22:20:48 -0700 Subject: [PATCH] feat: persist crafting zone selection in sessionStorage Applies the same sticky-zone pattern as the boss, quest, and exploration panels. A handleZoneSelect wrapper is introduced so that sessionStorage is updated alongside React state on every zone change. --- apps/web/src/components/game/craftingPanel.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/web/src/components/game/craftingPanel.tsx b/apps/web/src/components/game/craftingPanel.tsx index 86ddcb4..e1deb95 100644 --- a/apps/web/src/components/game/craftingPanel.tsx +++ b/apps/web/src/components/game/craftingPanel.tsx @@ -26,7 +26,9 @@ const bonusLabel: Record = { */ const CraftingPanel = (): JSX.Element => { const { state, craftRecipe, formatNumber } = useGame(); - const [ activeZoneId, setActiveZoneId ] = useState("verdant_vale"); + const [ activeZoneId, setActiveZoneId ] = useState(() => { + return sessionStorage.getItem("elysium_craft_zone") ?? "verdant_vale"; + }); const [ pendingRecipeId, setPendingRecipeId ] = useState(null); if (state === null) { @@ -68,6 +70,11 @@ const CraftingPanel = (): JSX.Element => { }); } + function handleZoneSelect(zoneId: string): void { + setActiveZoneId(zoneId); + sessionStorage.setItem("elysium_craft_zone", zoneId); + } + async function handleCraft(recipeId: string): Promise { setPendingRecipeId(recipeId); try { @@ -85,7 +92,7 @@ const CraftingPanel = (): JSX.Element => {