chore: sync price monitor updates
This commit is contained in:
@@ -182,13 +182,13 @@ function applyProductsList(products: Product[]) {
|
||||
productsPageLoading.value = false
|
||||
}
|
||||
|
||||
/** قیمت enrich شده فقط در HTTP کامل است؛ slim SSE برای پرچمهاست */
|
||||
function onTvBoard() {
|
||||
if (typeof window === 'undefined') return false
|
||||
const path = window.location.pathname.replace(/\/+$/, '') || '/'
|
||||
return path === '/tv' || path.endsWith('/tv') || path === '/monitor' || path.endsWith('/monitor')
|
||||
}
|
||||
|
||||
/** قیمت enrich شده فقط در HTTP کامل است؛ slim SSE برای پرچمهاست */
|
||||
function scheduleCatalogRefreshFromStream() {
|
||||
if (onTvBoard()) return
|
||||
if (catalogStreamRefreshTimer) {
|
||||
@@ -196,10 +196,7 @@ function scheduleCatalogRefreshFromStream() {
|
||||
}
|
||||
catalogStreamRefreshTimer = setTimeout(() => {
|
||||
catalogStreamRefreshTimer = undefined
|
||||
void import('@/utils/priceSocket').then(({ isTvStreamActive }) => {
|
||||
if (isTvStreamActive()) return
|
||||
void refreshProductsPageData()
|
||||
})
|
||||
void refreshProductsPageData()
|
||||
}, 150)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user