cahce apraisal
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { MarketTypePrice, getMarketTypes, getPrices } from "@/market";
|
||||
import { MarketTypePrice, getMarketTypes, useApraisalStore } from "@/market";
|
||||
import { BuyModal, SellModal, TrackResultTable, TrackedItem, useTrackedItemStore } from '@/market/track';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
const buyModal = ref<typeof BuyModal>();
|
||||
const sellModal = ref<typeof SellModal>();
|
||||
|
||||
|
||||
const apraisalStore = useApraisalStore();
|
||||
const trackedItemStore = useTrackedItemStore();
|
||||
const items = ref<TrackedItem[]>([]);
|
||||
|
||||
@@ -14,7 +16,7 @@ watch(() => trackedItemStore.items.value, async itms => {
|
||||
return;
|
||||
}
|
||||
|
||||
const prices = await getPrices(await getMarketTypes(itms.map(i => i.typeID)));
|
||||
const prices = await apraisalStore.getPrices(await getMarketTypes(itms.map(i => i.typeID)));
|
||||
|
||||
items.value = itms.map(i => {
|
||||
const price = prices.find(p => p.type.id === i.typeID) as MarketTypePrice;
|
||||
|
||||
Reference in New Issue
Block a user