refactor: remove refresh from stores
This commit is contained in:
@@ -21,7 +21,7 @@ const sellModal = ref<typeof SellModal>();
|
||||
const apraisalStore = useApraisalStore();
|
||||
const enriched = ref<AcquiredType[]>([]);
|
||||
|
||||
watch(() => props.items, async itms => {
|
||||
const refresh = async (itms: RawAcquiredType[] = props.items) => {
|
||||
if (itms.length === 0) {
|
||||
enriched.value = [];
|
||||
return;
|
||||
@@ -40,7 +40,11 @@ watch(() => props.items, async itms => {
|
||||
sell: price.sell
|
||||
};
|
||||
});
|
||||
}, {immediate: true});
|
||||
};
|
||||
|
||||
watch(() => props.items, refresh, {immediate: true});
|
||||
|
||||
defineExpose({refresh});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user