chore: sync project updates

This commit is contained in:
2026-09-28 14:12:30 +03:30
parent bc64ff47b2
commit 1ac5095177
15 changed files with 17305 additions and 28 deletions
+19 -8
View File
@@ -282,21 +282,28 @@ export function notifyPriceLastFetchFailed() {
void maybeShowNetworkAlert()
}
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')
}
async function runFallbackPoll() {
if (!priceWssEnabled.value || priceSocketConnected.value) {
if (onTvBoard() || tvStreamKey || !priceWssEnabled.value || priceSocketConnected.value) {
return
}
try {
const { getLastPrices, hasRecentPriceFromSource } = await import('@/utils/price')
const { refreshProductsPageData } = await import(
'@/views/base/products/composables/useProductsPageData'
)
const jobs: Promise<unknown>[] = [getLastPrices()]
if (!tvStreamKey) {
const { refreshProductsPageData } = await import(
'@/views/base/products/composables/useProductsPageData'
)
jobs.push(refreshProductsPageData())
}
const [priceResult] = await Promise.allSettled([
getLastPrices(),
refreshProductsPageData(),
])
const [priceResult] = await Promise.allSettled(jobs)
const priceOk =
priceResult.status === 'fulfilled'
@@ -743,6 +750,10 @@ function unbindBrowserNetworkListeners() {
window.removeEventListener('offline', onBrowserOffline)
}
export function isTvStreamActive() {
return Boolean(tvStreamKey)
}
export function startTvPriceStream(
settingGetter: (key: string) => unknown,
key: string,