Skip to content

Commit

Permalink
fix: 🐛 Query settings reset on editor destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Czapkowicz committed Nov 30, 2021
1 parent 4eddd9c commit 866a286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Editor/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ const Editor: FC<Props> = ({

useEffect(() => {
return () => {
dispatch(queriesActions.clearQuerySettings());
dispatch(editorActions.setActiveEditorTab(EditorSection.QUERY));
dispatch(editorActions.setActiveSettingsSection(MENU_ITEMS_ENUM.TITLES));
};
Expand Down
3 changes: 3 additions & 0 deletions src/modules/queries/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ export const queriesSlice = createSlice({
) => {
state.settings = payload.settings;
},
clearQuerySettings: (state) => {
state.settings = {};
},
resetQueryResults: (state) => {
state.results = null;
},
Expand Down

0 comments on commit 866a286

Please sign in to comment.