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

Fix session recording navigation from persons page (#5404)

* fix close recording player from persons

* set proper tab when watching a recording
This commit is contained in:
Paolo D'Amico 2021-08-02 07:31:05 -07:00 committed by GitHub
parent 796fa106fe
commit 0a46442b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -201,10 +201,13 @@ export const personsLogic = kea<personsLogicType<PersonPaginatedResponse>>({
actions.loadPersons()
}
},
'/person/*': ({ _: person }, _searchParams, { activeTab }) => {
if (activeTab && values.activeTab !== activeTab) {
'/person/*': ({ _: person }, { sessionRecordingId }, { activeTab }) => {
if (sessionRecordingId) {
actions.navigateToTab(PersonsTabType.SESSIONS)
} else if (activeTab && values.activeTab !== activeTab) {
actions.navigateToTab(activeTab as PersonsTabType)
}
if (person) {
actions.loadPerson(person) // underscore contains the wildcard
}

View File

@ -63,7 +63,7 @@ export const sessionsTableLogic = kea<sessionsTableLogicType<SessionRecordingId>
properties,
selectedDate,
}),
setSessionRecordingId: (sessionRecordingId: SessionRecordingId) => ({ sessionRecordingId }),
setSessionRecordingId: (sessionRecordingId: SessionRecordingId | null) => ({ sessionRecordingId }),
closeSessionPlayer: true,
loadSessionEvents: (session: SessionType) => ({ session }),
addSessionEvents: (session: SessionType, events: EventType[]) => ({ session, events }),
@ -290,8 +290,8 @@ export const sessionsTableLogic = kea<sessionsTableLogicType<SessionRecordingId>
actions.loadSessions(true)
}
if (params.sessionRecordingId && params.sessionRecordingId !== values.sessionRecordingId) {
actions.setSessionRecordingId(params.sessionRecordingId)
if (params.sessionRecordingId !== values.sessionRecordingId) {
actions.setSessionRecordingId(params.sessionRecordingId ?? null)
}
if (JSON.stringify(params.filters || {}) !== JSON.stringify(values.filters)) {