0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00

fix: Recording event loading (#12297)

Co-authored-by: Alex Kim <alexgkim205@gmail.com>
This commit is contained in:
Ben White 2022-10-17 18:42:51 +02:00 committed by GitHub
parent 7aaa6ef710
commit 9f0602a6d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 12 deletions

View File

@ -74,7 +74,7 @@ export function PlayerList<T extends Record<string, any>>({
return (
<div className="PlayerList">
{sessionEventsDataLoading || sessionPlayerMetaDataLoading ? (
{!data.length && (sessionEventsDataLoading || sessionPlayerMetaDataLoading) ? (
<SpinnerOverlay />
) : (
<>

View File

@ -46,7 +46,7 @@ export const eventsListLogic = kea<eventsListLogicType>([
logic: [eventUsageLogic],
actions: [
sessionRecordingDataLogic({ sessionRecordingId }),
['setFilters', 'loadEventsSuccess'],
['setFilters'],
sessionRecordingPlayerLogic({ sessionRecordingId, playerKey }),
['seek'],
],

View File

@ -172,14 +172,6 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
loadRecordingSnapshotsSuccess: (state) => state + 1,
},
],
sessionEventsDataLoading: [
false,
{
loadEventsSuccess: (_, { sessionEventsData }) => {
return !!sessionEventsData?.next
},
},
],
loadMetaTimeMs: [
null as number | null,
{
@ -236,14 +228,14 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
else {
eventUsageLogic.actions.reportRecording(
values.sessionPlayerData,
performance.now() - cache.startTime,
performance.now() - cache.loadStartTime,
SessionRecordingUsageType.LOADED,
0
)
}
// Not always accurate that recording is playable after first chunk is loaded, but good guesstimate for now
if (values.chunkPaginationIndex === 1) {
actions.reportUsage(values.sessionPlayerData, performance.now() - cache.startTime)
actions.reportUsage(values.sessionPlayerData, performance.now() - cache.loadStartTime)
}
},
loadEventsSuccess: () => {