Skip to content

Commit

Permalink
fix(redux): disable devtools (#24611)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul D'Ambra <[email protected]>
  • Loading branch information
mariusandra and pauldambra authored Aug 27, 2024
1 parent 4d99a9c commit a43f6b1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions frontend/src/initKea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,28 @@ export function initKea({ routerHistory, routerLocation, beforePlugins }: InitKe
plugins.push(loggerPlugin)
}

if ((window as any).__REDUX_DEVTOOLS_EXTENSION__) {
// eslint-disable-next-line no-console
console.log('NB Redux Dev Tools are disabled on PostHog. See: https://github.com/PostHog/posthog/issues/17482')
}

resetContext({
plugins: plugins,
createStore: {
// Disable redux dev-tools's compose by passing `compose` from redux directly
compose: ((...funcs: any[]) => {
if (funcs.length === 0) {
return <T>(arg: T) => arg
}
if (funcs.length === 1) {
return funcs[0]
}
return funcs.reduce(
(a, b) =>
(...args: any) =>
a(b(...args))
)
}) as any,
},
})
}

0 comments on commit a43f6b1

Please sign in to comment.