diff --git a/src/market/Market.vue b/src/market/Market.vue index 6f9edc0..ef37db0 100644 --- a/src/market/Market.vue +++ b/src/market/Market.vue @@ -12,7 +12,8 @@ type MarketItemStorage = { } const item = ref(""); -const itemsStorage = useStorage('market-items', []); +const oldStorage = useStorage('market-items', []); // TODO: remove this after a while +const itemsStorage = useStorage('market-scan-items', []); const items = ref([]); const addOrRelaod = async (type: MarketType) => { const typeID = type.id; @@ -45,7 +46,14 @@ const addItem = async () => { watch(items, itms => itemsStorage.value = itms.map(i => ({ typeID: i.type.id, history: i.history }))); onMounted(async () => { + if (itemsStorage.value.length === 0) { + if (oldStorage.value.length > 0) { + itemsStorage.value = oldStorage.value; + oldStorage.value = []; + } else { + return; + } return; } diff --git a/src/market/MarketResultTable.vue b/src/market/MarketResultTable.vue index 93535c1..103329b 100644 --- a/src/market/MarketResultTable.vue +++ b/src/market/MarketResultTable.vue @@ -33,8 +33,8 @@ const props = withDefaults(defineProps(), { }); defineEmits(); -const days = useStorage('market-days', 365); -const threshold = useStorage('market-profit-threshold', 10); +const days = useStorage('market-scan-days', 365); +const threshold = useStorage('market-scan-threshold', 10); const filter = ref(""); const { sortedArray, headerProps } = useSort(computed(() => props.items .filter(r => r.type.name.toLowerCase().includes(filter.value.toLowerCase()))