chore: sync project updates
This commit is contained in:
@@ -182,14 +182,24 @@ function applyProductsList(products: Product[]) {
|
||||
productsPageLoading.value = false
|
||||
}
|
||||
|
||||
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) {
|
||||
clearTimeout(catalogStreamRefreshTimer)
|
||||
}
|
||||
catalogStreamRefreshTimer = setTimeout(() => {
|
||||
catalogStreamRefreshTimer = undefined
|
||||
void refreshProductsPageData()
|
||||
void import('@/utils/priceSocket').then(({ isTvStreamActive }) => {
|
||||
if (isTvStreamActive()) return
|
||||
void refreshProductsPageData()
|
||||
})
|
||||
}, 150)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user