added sse2

This commit is contained in:
2026-06-18 20:04:50 +03:30
parent f3aaf9d7c0
commit e27fdeb102
4 changed files with 62 additions and 29 deletions
@@ -7,6 +7,7 @@ import { loadProductCategoryTabNames } from '@/utils/categoryTabs'
import { getLastPrices, startLastPricePolling, stopLastPricePolling } from '@/utils/price'
import {
priceSocketConnected,
priceStreamLifecycle,
priceWssEnabled,
shouldUsePricePolling,
} from '@/utils/priceSocketState'
@@ -127,14 +128,9 @@ function syncProductListPolling() {
}
watch(
() => [priceWssEnabled.value, priceSocketConnected.value] as const,
([wssEnabled, connected], prev) => {
const prevConnected = prev?.[1]
() => [priceWssEnabled.value, priceSocketConnected.value, priceStreamLifecycle.value] as const,
() => {
syncProductListPolling()
if (wssEnabled && prevConnected && !connected && initialized.value) {
void refreshProductsPageData()
}
},
)
@@ -158,7 +154,9 @@ export function onProductsPageProviderMounted() {
providerMountCount += 1
pricePollingMountCount += 1
if (pricePollingMountCount === 1) {
void getLastPrices()
if (shouldUsePricePolling()) {
void getLastPrices()
}
startLastPricePolling()
}
}