diff --git a/frontend/src/initKea.ts b/frontend/src/initKea.ts index d3051cb01a06d..99a00f2e255d4 100644 --- a/frontend/src/initKea.ts +++ b/frontend/src/initKea.ts @@ -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, diff --git a/frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts b/frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts index b6e0ef59d53b8..d9696985e600b 100644 --- a/frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts +++ b/frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts @@ -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([ path(['scenes', 'heatmaps', 'heatmapsBrowserLogic']), props({} as HeatmapsBrowserLogicProps), @@ -172,7 +175,7 @@ export const heatmapsBrowserLogic = kea([ ], browserUrl: [ null as string | null, - { persist: true }, + { persist: true, prefix: `${teamId}__` }, { setBrowserUrl: (_, { url }) => url, },