diff --git a/web/src/pages/[gameId]/travel.tsx b/web/src/pages/[gameId]/travel.tsx index b59f78922..11c798b94 100644 --- a/web/src/pages/[gameId]/travel.tsx +++ b/web/src/pages/[gameId]/travel.tsx @@ -65,13 +65,12 @@ export default function Travel() { locationPrices.get(currentLocationId), ); const targetMarkets = sortDrugMarkets(locationPrices.get(targetId)); - return targetMarkets.map((drug, index) => { - return { - id: drug.id, - price: drug.price, - targetDiff: drug.price - currentMarkets[index].price, - }; - }); + + return targetMarkets.map((drug, index) => ({ + id: drug.id, + price: drug.price, + targetDiff: drug.price - currentMarkets[index].price, + })); } return []; @@ -112,18 +111,16 @@ export default function Travel() { if (targetId) { setIsSubmitting(true); const { event, hash } = await travel(gameId, targetId); - if (event) { - router.push(`/${gameId}/event/decision?nextId=${targetId}`); - } else { - toast( - `You've traveled to ${getLocationById(targetId)?.name}`, - Car, - `http://amazing_explorer/${hash}`, - ); - - router.push(`/${gameId}/turn`); + return router.push(`/${gameId}/event/decision?nextId=${targetId}`); } + + toast( + `You've traveled to ${getLocationById(targetId)?.name}`, + Car, + `http://amazing_explorer/${hash}`, + ); + router.push(`/${gameId}/turn`); } }, [targetId, router, gameId, travel, toast]); @@ -136,7 +133,7 @@ export default function Travel() { prefixTitle: "Select Your", map: ( { setTargetId(getLocationByType(selected)!.id); }}