Skip to content

Commit

Permalink
fix: reset selected table and query settings when a new connection is…
Browse files Browse the repository at this point in the history
… set
  • Loading branch information
grailian committed Aug 9, 2017
1 parent fd45078 commit cea945b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/data/selected-table.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function code(state = defaultCode, action) {
return state;
}

export default combineReducers({
const selectedTableReducer = combineReducers({
databaseName,
name,
query,
Expand All @@ -185,3 +185,11 @@ export default combineReducers({
lastResult,
queryError
});

export default function(state, action) {
if (action.type === types.SET_CONNECTION) {
state = undefined;
}

return selectedTableReducer(state, action)
}

0 comments on commit cea945b

Please sign in to comment.