From 2149e729cd6d9d99196cc9b029ec211e79b96742 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Fri, 6 Dec 2024 20:17:33 +0000 Subject: [PATCH] fix: prefer snapshot times once both loaded --- .../session-recordings/player/sessionRecordingDataLogic.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingDataLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingDataLogic.ts index f8741034fb910..14a8819c06173 100644 --- a/frontend/src/scenes/session-recordings/player/sessionRecordingDataLogic.ts +++ b/frontend/src/scenes/session-recordings/player/sessionRecordingDataLogic.ts @@ -980,6 +980,10 @@ export const sessionRecordingDataLogic = kea([ const eventStart = meta?.start_time ? dayjs(meta.start_time) : null const snapshotStart = firstSnapshot ? dayjs(firstSnapshot.timestamp) : null + if (snapshotStart && eventStart) { + return snapshotStart + } + return snapshotStart || eventStart }, ], @@ -992,7 +996,7 @@ export const sessionRecordingDataLogic = kea([ // whichever is latest if (eventEnd && snapshotEnd) { - return eventEnd.isAfter(snapshotEnd) ? eventEnd : snapshotEnd + return snapshotEnd } return eventEnd || snapshotEnd },