feat(#48): Add location picker for acquisition, type info and appraisal pages
This commit is contained in:
@@ -3,9 +3,11 @@ import {RouterLink, RouterView} from 'vue-router';
|
||||
import {appraiseItemBalances, getLedgerBalance, isMain, LedgerLabel, useLedgerParam} from "@/ledger";
|
||||
import {routeNames} from "@/routes.ts";
|
||||
import {getMarketTypes, getPrices, IskLabel} from "@/market";
|
||||
import {useMarketLocationStore} from '@/market/location';
|
||||
import {computedAsync} from "@vueuse/core";
|
||||
|
||||
const {ledgerId, ledger} = useLedgerParam();
|
||||
const marketLocationStore = useMarketLocationStore();
|
||||
|
||||
const itemAppraisal = computedAsync(async () => {
|
||||
if (!ledgerId.value) {
|
||||
@@ -19,7 +21,7 @@ const itemAppraisal = computedAsync(async () => {
|
||||
}
|
||||
|
||||
const types = await getMarketTypes([...new Set(itemBalances.map(i => i.typeId))]);
|
||||
const prices = await getPrices(types);
|
||||
const prices = await getPrices(types, marketLocationStore.location.id);
|
||||
const appraisal = appraiseItemBalances(itemBalances, prices);
|
||||
|
||||
return appraisal.buy === 0 && appraisal.sell === 0 ? undefined : appraisal;
|
||||
|
||||
Reference in New Issue
Block a user