chore: sync price monitor updates

This commit is contained in:
2026-09-28 18:04:49 +03:30
parent f778064aef
commit 9cb0979606
7 changed files with 88 additions and 112 deletions
@@ -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)
}