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
+3 -7
View File
@@ -3,6 +3,7 @@ import type { Price, PriceUp } from '@/models/home'
import { ref, watch } from 'vue'
import {
priceSocketConnected,
priceStreamLifecycle,
priceWssEnabled,
shouldUsePricePolling,
} from '@/utils/priceSocketState'
@@ -63,14 +64,9 @@ function syncLastPricePolling() {
}
watch(
() => [priceWssEnabled.value, priceSocketConnected.value] as const,
([wssEnabled, connected], prev) => {
const prevConnected = prev?.[1]
() => [priceWssEnabled.value, priceSocketConnected.value, priceStreamLifecycle.value] as const,
() => {
syncLastPricePolling()
if (wssEnabled && prevConnected && !connected && lastSubscribers > 0) {
void getLastPrices()
}
},
)