fix ui: fix first event calculation
This commit is contained in:
parent
f7fcde48ed
commit
bac0360735
3 changed files with 9 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue