Skip to content

Commit

Permalink
Ensure connectToDevtools: null is backwards compatible
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
  • Loading branch information
jerelmiller and phryneas authored Jul 9, 2024
1 parent 684b9fc commit a83ccf2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,14 @@ export class ApolloClient<TCacheShape> implements DataProxy {
this.devtoolsConfig = {
...devtools,
enabled:
devtools?.enabled ??
connectToDevTools ??
(typeof window === "object" &&
(window as any).__APOLLO_CLIENT__ &&
__DEV__),
devtools?.enabled ||
connectToDevTools,
};
if (this.devtoolsConfig.enabled === undefined) {
this.devtoolsConfig.enabled = (typeof window === "object" &&
(window as any).__APOLLO_CLIENT__ &&
__DEV__)
}

if (ssrForceFetchDelay) {
setTimeout(
Expand Down

0 comments on commit a83ccf2

Please sign in to comment.