generated from nhcarrigan/template
Compare commits
5 Commits
v0.1.2
..
c3e85c3768
| Author | SHA1 | Date | |
|---|---|---|---|
|
c3e85c3768
|
|||
|
2c16736bdf
|
|||
|
0dc572c6fa
|
|||
|
9fcc5bb836
|
|||
|
fc93efd245
|
@@ -26,9 +26,7 @@ const bonusLabel: Record<string, string> = {
|
||||
*/
|
||||
const CraftingPanel = (): JSX.Element => {
|
||||
const { state, craftRecipe, formatNumber } = useGame();
|
||||
const [ activeZoneId, setActiveZoneId ] = useState(() => {
|
||||
return sessionStorage.getItem("elysium_craft_zone") ?? "verdant_vale";
|
||||
});
|
||||
const [ activeZoneId, setActiveZoneId ] = useState("verdant_vale");
|
||||
const [ pendingRecipeId, setPendingRecipeId ] = useState<string | null>(null);
|
||||
|
||||
if (state === null) {
|
||||
@@ -70,11 +68,6 @@ const CraftingPanel = (): JSX.Element => {
|
||||
});
|
||||
}
|
||||
|
||||
function handleZoneSelect(zoneId: string): void {
|
||||
setActiveZoneId(zoneId);
|
||||
sessionStorage.setItem("elysium_craft_zone", zoneId);
|
||||
}
|
||||
|
||||
async function handleCraft(recipeId: string): Promise<void> {
|
||||
setPendingRecipeId(recipeId);
|
||||
try {
|
||||
@@ -92,7 +85,7 @@ const CraftingPanel = (): JSX.Element => {
|
||||
|
||||
<ZoneSelector
|
||||
activeZoneId={activeZoneId}
|
||||
onSelectZone={handleZoneSelect}
|
||||
onSelectZone={setActiveZoneId}
|
||||
zones={zones}
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user