Skip to content

Commit

Permalink
fix(Commit): redirect to the commit after saving a version
Browse files Browse the repository at this point in the history
Once you've saved a version, re-direct the user to the version in history.
  • Loading branch information
ramfox committed Dec 16, 2019
1 parent bcd761e commit 53f1774
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions app/actions/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,17 @@ export function saveWorkingDatasetAndFetch (): ApiActionThunk {
const whenOk = chainSuccess(dispatch, getState)
let response: Action

response = await saveWorkingDataset()(dispatch, getState)
response = await whenOk(fetchWorkingDatasetDetails())(response)

try {
response = await saveWorkingDataset()(dispatch, getState)
const path = response.payload.data.dataset.path
response = await whenOk(fetchWorkingDatasetDetails())(response)
dispatch(setSelectedListItem('commit', path))
dispatch(setActiveTab('history'))
dispatch(setSelectedListItem('commitComponent', DEFAULT_SELECTED_COMPONENT))
} catch (action) {
dispatch(openToast('error', action.payload.err.message))
throw action
}
return response
}
}
Expand Down

0 comments on commit 53f1774

Please sign in to comment.