diff --git a/apps/frontend-old/src/pages/ships/components/Ship/index.tsx b/apps/frontend-old/src/pages/ships/components/Ship/index.tsx index c0e958a..a1312ec 100644 --- a/apps/frontend-old/src/pages/ships/components/Ship/index.tsx +++ b/apps/frontend-old/src/pages/ships/components/Ship/index.tsx @@ -30,7 +30,7 @@ export const ShipCard = ({ ship }: Props) => { const isF = isFirefox(); - const url = ship.markets.length + const url = ship.markets?.length ? `https://play.staratlas.com/market/${ship.name .toLowerCase() .replace(/\s/g, '-')}` diff --git a/apps/frontend-old/src/stores/useShipsDealsStore/index.ts b/apps/frontend-old/src/stores/useShipsDealsStore/index.ts index 2f96232..2a406a1 100644 --- a/apps/frontend-old/src/stores/useShipsDealsStore/index.ts +++ b/apps/frontend-old/src/stores/useShipsDealsStore/index.ts @@ -64,7 +64,7 @@ export const useShipsDealsStore = create((set, get) => ({ const data = ships.map((ship) => { const vwapPrice = - ship.tradeSettings.vwap ?? getEntityVwapPrice(ship.primarySales); + ship.tradeSettings.vwap ?? getEntityVwapPrice(ship.primarySales ?? []); const buyPrice = Math.min( ...(orders.usdc.sell diff --git a/apps/frontend/src/pages/ships/components/ShipList/index.tsx b/apps/frontend/src/pages/ships/components/ShipList/index.tsx index fdb5b71..8539289 100644 --- a/apps/frontend/src/pages/ships/components/ShipList/index.tsx +++ b/apps/frontend/src/pages/ships/components/ShipList/index.tsx @@ -1,20 +1,20 @@ import { Button, Flex, StarAtlasShip } from '@saibase/uikit'; import Link from 'next/link'; import { useRouter } from 'next/router'; -import { useShips } from "../../../../hooks/useShips"; -import { Translation } from "../../../../i18n/Translation"; +import { useShips } from '../../../../hooks/useShips'; +import { Translation } from '../../../../i18n/Translation'; export const ShipList = () => { const { ships } = useShips(); const { locale } = useRouter(); return ( - ( {ships.map((ship) => { - const url = ship.markets.length + const url = ship.markets?.length ? `https://play.staratlas.com/market/${ship.name .toLowerCase() .replace(/\s/g, '-')}` @@ -60,6 +60,6 @@ export const ShipList = () => { /> ); })} - ) + ); }; diff --git a/apps/frontend/src/stores/useShipsDealsStore/index.ts b/apps/frontend/src/stores/useShipsDealsStore/index.ts index 3ced82a..c832a16 100644 --- a/apps/frontend/src/stores/useShipsDealsStore/index.ts +++ b/apps/frontend/src/stores/useShipsDealsStore/index.ts @@ -63,7 +63,7 @@ export const useShipsDealsStore = create((set, get) => ({ const data = ships.map((ship) => { const vwapPrice = - ship.tradeSettings.vwap ?? getEntityVwapPrice(ship.primarySales); + ship.tradeSettings.vwap ?? getEntityVwapPrice(ship.primarySales ?? []); const buyPrice = Math.min( ...(orders.usdc.sell diff --git a/apps/patch-bot/src/jobs/fleetSnapshots/fetchFleetStatsByOwners/index.ts b/apps/patch-bot/src/jobs/fleetSnapshots/fetchFleetStatsByOwners/index.ts index a773e27..afae131 100644 --- a/apps/patch-bot/src/jobs/fleetSnapshots/fetchFleetStatsByOwners/index.ts +++ b/apps/patch-bot/src/jobs/fleetSnapshots/fetchFleetStatsByOwners/index.ts @@ -53,7 +53,7 @@ export const fetchFleetStatsByOwners = async ( ...shipsStats.ships, [ship.mint]: { ...shipsStats.ships[ship.mint], - vwap: getEntityVwapPrice(ship.primarySales), + vwap: getEntityVwapPrice(ship.primarySales ?? []), mint: ship.mint, name: ship.name, attributes: ship.attributes,