Skip to content

Commit

Permalink
fix: persisting browser url in heatmaps apge (#26462)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Dec 3, 2024
1 parent 7c3c1f8 commit 121ac14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/initKea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const loggerPlugin: () => KeaPlugin = () => ({
export function initKea({ routerHistory, routerLocation, beforePlugins }: InitKeaProps = {}): void {
const plugins = [
...(beforePlugins || []),
localStoragePlugin,
localStoragePlugin(),
windowValuesPlugin({ window: window }),
routerPlugin({
history: routerHistory,
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export interface IFrameBanner {
message: string | JSX.Element
}

// team id is always available on window
const teamId = window.POSTHOG_APP_CONTEXT?.current_team?.id

export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
path(['scenes', 'heatmaps', 'heatmapsBrowserLogic']),
props({} as HeatmapsBrowserLogicProps),
Expand Down Expand Up @@ -172,7 +175,7 @@ export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
],
browserUrl: [
null as string | null,
{ persist: true },
{ persist: true, prefix: `${teamId}__` },
{
setBrowserUrl: (_, { url }) => url,
},
Expand Down

0 comments on commit 121ac14

Please sign in to comment.