Skip to content

Commit

Permalink
fix: close the dataset list when a new dataset is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Sep 4, 2019
1 parent 899b103 commit 3f24a82
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/reducers/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ const initialState = {
// send an event to electron to block menus on first load
ipcRenderer.send('block-menus', true)

const [, DATASET_SUCC] = apiActionTypes('dataset')

export default (state = initialState, action: AnyAction) => {
switch (action.type) {
case UI_TOGGLE_DATASET_LIST:
Expand Down Expand Up @@ -141,6 +143,14 @@ export default (state = initialState, action: AnyAction) => {
...state,
qriCloudAuthenticated: false
}

// close the dataset list when the user chooses a new dataset or adds a new dataset
case DATASET_SUCC:
return {
...state,
showDatasetList: false
}

default:
return state
}
Expand Down

0 comments on commit 3f24a82

Please sign in to comment.