Skip to content

Commit

Permalink
Hide Beta DC from website for now (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
karashiiro authored Oct 4, 2023
1 parent 4dfc072 commit 7e96ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 5 additions & 5 deletions components/Market/MarketRegion/MarketRegion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function MarketRegion({
.sort((a, b) => b.timestamp - a.timestamp);

const hqListings = allListings?.filter((listing: any) => listing.hq) ?? [];
const nqListings = allListings.filter((listing: any) => !listing.hq) ?? [];
const nqListings = allListings?.filter((listing: any) => !listing.hq) ?? [];
const hqSales = allSales?.filter((sale: any) => sale.hq) ?? [];
const nqSales = allSales?.filter((sale: any) => !sale.hq) ?? [];

Expand Down Expand Up @@ -75,22 +75,22 @@ export default function MarketRegion({
const hqSalesAveragePpu =
Math.ceil(
hqSales.map((sale: any) => sale.pricePerUnit).reduce((agg: any, next: any) => agg + next, 0) /
hqSales.length
hqSales.length
) || 0;
const nqSalesAveragePpu =
Math.ceil(
nqSales.map((sale: any) => sale.pricePerUnit).reduce((agg: any, next: any) => agg + next, 0) /
nqSales.length
nqSales.length
) || 0;
const hqSalesAverageTotal =
Math.ceil(
hqSales.map((sale: any) => sale.total).reduce((agg: any, next: any) => agg + next, 0) /
hqSales.length
hqSales.length
) || 0;
const nqSalesAverageTotal =
Math.ceil(
nqSales.map((sale: any) => sale.total).reduce((agg: any, next: any) => agg + next, 0) /
nqSales.length
nqSales.length
) || 0;

return (
Expand Down
12 changes: 7 additions & 5 deletions service/servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ async function getServersInternal(): Promise<Servers> {

const worlds: World[] = await fetch(`${getBaseUrl()}/v3/game/worlds`).then((res) => res.json());

const dcs = dcData.map((dc) => ({
name: dc.name,
region: dc.region,
worlds: dc.worlds.map((worldId) => worlds.find((w) => w.id === worldId)!),
}));
const dcs = dcData
.filter((region) => !region.name.includes('Beta'))
.map((dc) => ({
name: dc.name,
region: dc.region,
worlds: dc.worlds.map((worldId) => worlds.find((w) => w.id === worldId)!),
}));

cache.servers = {
value: { dcs, worlds },
Expand Down

0 comments on commit 7e96ad8

Please sign in to comment.