added sse2
This commit is contained in:
+3
-7
@@ -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()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user