fix price
This commit is contained in:
@@ -102,6 +102,7 @@ import { isProductPriceInactive } from '@/utils/productPrice'
|
||||
import { isMetalCommodityGroup, isMeltedTradeGroup } from '@/utils/productCategories'
|
||||
import { isBoursecuDealProductGroup } from '@/utils/productDealMethod'
|
||||
import { loadServiceFeeFromSettings } from '@/utils/serviceFee'
|
||||
import { getLastPrices, startLastPricePolling, stopLastPricePolling } from '@/utils/price'
|
||||
|
||||
const activekey = ref('طلا' ||'آبشده')
|
||||
const showFilter = ref(false)
|
||||
@@ -210,6 +211,8 @@ async function refreshProducts() {
|
||||
onMounted(async () => {
|
||||
try {
|
||||
loading.value = true
|
||||
await getLastPrices()
|
||||
startLastPricePolling()
|
||||
items.value = await getProducts()
|
||||
|
||||
if (items.value?.length) {
|
||||
@@ -225,7 +228,6 @@ onMounted(async () => {
|
||||
})
|
||||
firstItems.value = items.value
|
||||
await loadServiceFeeFromSettings()
|
||||
// فقط لیست محصولات هر ۱۰ ثانیه — last فقط در صفحه اصلی poll میشود
|
||||
productListInterval = setInterval(refreshProducts, 10000)
|
||||
|
||||
} catch (e) {
|
||||
@@ -247,6 +249,7 @@ onMounted(async () => {
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
stopLastPricePolling()
|
||||
if (productListInterval) {
|
||||
clearInterval(productListInterval)
|
||||
productListInterval = undefined
|
||||
|
||||
Reference in New Issue
Block a user