|
|
@@ -34,12 +34,10 @@ document.querySelector('#copy-xit-act')!.addEventListener('click', () => {
|
|
|
setupPopover();
|
|
|
|
|
|
async function calculate(username: string, apiKey: string, supplyForDays: number, cx: keyof typeof warehouseNames): Promise<void> {
|
|
|
- const [prices, planets, avail, {bids, orders}] = await Promise.all([
|
|
|
- getPrices(cx),
|
|
|
- getPlanets(username, apiKey),
|
|
|
- warehouseInventory(username, apiKey, warehouseNames[cx]),
|
|
|
- getBids(username, apiKey, cx)
|
|
|
- ]);
|
|
|
+ const prices = await getPrices(cx);
|
|
|
+ const planets = await getPlanets(username, apiKey);
|
|
|
+ const avail = await warehouseInventory(username, apiKey, warehouseNames[cx]);
|
|
|
+ const {bids, orders} = await getBids(username, apiKey, cx);
|
|
|
const buy = new Map<string, number>();
|
|
|
for (const planet of planets) {
|
|
|
for (const [mat, amount] of planet.supplyForDays(supplyForDays))
|