Skip to content

Commit

Permalink
fix: workingDataset gets fsi state
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswhong committed Aug 2, 2019
1 parent 639d834 commit aaa0daa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/actions/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,20 @@ export function fetchMyDatasets (): ApiActionThunk {

export function fetchWorkingDataset (): ApiActionThunk {
return async (dispatch, getState) => {
const { selections } = getState()
const { selections, myDatasets } = getState()
const { peername, name } = selections

// find the selected dataset in myDatasets to determine isLinked
const match = myDatasets.value.find((d) => d.name === name && d.peername === peername)

const params = (match && match.isLinked) ? { fsi: true } : {}

const action = {
type: 'dataset',
[CALL_API]: {
endpoint: 'dataset',
method: 'GET',
params,
segments: {
peername: selections.peername,
name: selections.name
Expand Down

0 comments on commit aaa0daa

Please sign in to comment.