Skip to content

Commit

Permalink
fix persisting headers in tab state
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasheyenbrock committed May 20, 2022
1 parent c2e2f53 commit 3606924
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/witty-papayas-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'graphiql': patch
---

Fix persisting headers in tab state and avoid opening duplicate tabs when reloading
2 changes: 1 addition & 1 deletion packages/graphiql/src/components/GraphiQL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ class GraphiQLWithContext extends React.Component<
'tabState',
JSON.stringify(this.state.tabs, (key, value) =>
key === 'response' ||
(this.state.shouldPersistHeaders && key === 'headers')
(!this.state.shouldPersistHeaders && key === 'headers')
? undefined
: value,
),
Expand Down

0 comments on commit 3606924

Please sign in to comment.