feat: align fee summary, special pricing and support chat with modular
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -9,6 +9,10 @@ import {
|
||||
priceStreamLifecycle,
|
||||
priceWssEnabled,
|
||||
} from '@/utils/priceSocketState'
|
||||
import {
|
||||
applyBoardSpecialToLastPayload,
|
||||
setSpecialPricingPayload,
|
||||
} from '@/utils/specialPricing'
|
||||
|
||||
export {
|
||||
priceSocketConnected,
|
||||
@@ -326,7 +330,7 @@ function handleLastPayload(payload: unknown) {
|
||||
return
|
||||
}
|
||||
|
||||
const last = payload as Price
|
||||
const last = applyBoardSpecialToLastPayload(payload as Price)
|
||||
if (last.price_last == null && last.price == null && last.buy == null) {
|
||||
return
|
||||
}
|
||||
@@ -413,6 +417,14 @@ function bindStreamEvents(source: EventSource) {
|
||||
}
|
||||
})
|
||||
|
||||
source.addEventListener('special-pricing', (event) => {
|
||||
try {
|
||||
setSpecialPricingPayload(JSON.parse(event.data))
|
||||
} catch (error) {
|
||||
console.warn('Special-pricing SSE parse failed', error)
|
||||
}
|
||||
})
|
||||
|
||||
source.addEventListener('ping', () => {
|
||||
touchStreamActivity()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user