fix ui: fix first event calculation

This commit is contained in:
nick-delirium 2024-07-17 18:01:08 +02:00
parent f7fcde48ed
commit bac0360735
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
3 changed files with 9 additions and 7 deletions

View file

@ -62,9 +62,9 @@ function ClickMapCard({
if (mapUrl) return evt.path.includes(mapUrl)
return evt
}) || { timestamp: metricStore.instance.data.startTs }
const jumpTimestamp = (jumpToEvent.timestamp - metricStore.instance.data.startTs) + jumpToEvent.domBuildingTime + 99 // 99ms safety margin to give some time for the DOM to load
const ts = jumpToEvent.timestamp ?? metricStore.instance.data.startTs
const domTime = jumpToEvent.domBuildingTime ?? 0
const jumpTimestamp = (ts - metricStore.instance.data.startTs) + domTime + 99 // 99ms safety margin to give some time for the DOM to load
return (
<div id="clickmap-render">
<ClickMapRenderer

View file

@ -51,8 +51,8 @@ function WebPlayer(props: any) {
const isPlayerReady = contextValue.store?.get().ready
React.useEffect(() => {
if (isPlayerReady && insights.size > 0 && jumpTimestamp) {
contextValue.player && contextValue.player.play()
if (isPlayerReady && insights.size > 0 && jumpTimestamp) {
setTimeout(() => {
contextValue.player.pause()
contextValue.player.jump(jumpTimestamp)

View file

@ -963,8 +963,8 @@ export default class App {
deviceMemory,
jsHeapSizeLimit,
timezone: getTimezone(),
width: window.innerWidth,
height: window.innerHeight,
width: window.screen.width,
height: window.screen.height,
}),
})
const {
@ -1220,7 +1220,9 @@ export default class App {
timezone: getTimezone(),
condition: conditionName,
assistOnly: startOpts.assistOnly ?? this.socketMode,
}),
width: window.screen.width,
height: window.screen.height
}),
})
if (r.status !== 200) {
const error = await r.text()