Commit 1b0b348a authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH

[js][exp] fix removed "ownProps.data" prop being used

parent b4d48da0
...@@ -1269,7 +1269,9 @@ export class ExperimentEditor extends React.Component<Props, State> { ...@@ -1269,7 +1269,9 @@ export class ExperimentEditor extends React.Component<Props, State> {
} }
const mapStateToProps = (state, ownProps) => { const mapStateToProps = (state, ownProps) => {
const tcName = ownProps.data.name.split('/').slice(1, 4).join('/'); const exps = Selectors.experimentGet(state);
const data = exps[ownProps.index] || undefined;
const tcName = data ? data.name.split('/').slice(1, 4).join('/') : '';
const tc = Selectors.toolchainGet(state).find(t => t.name === tcName) || { const tc = Selectors.toolchainGet(state).find(t => t.name === tcName) || {
name: '', name: '',
contents: { contents: {
...@@ -1278,13 +1280,12 @@ const mapStateToProps = (state, ownProps) => { ...@@ -1278,13 +1280,12 @@ const mapStateToProps = (state, ownProps) => {
datasets: [], datasets: [],
} }
}; };
const exps = Selectors.experimentGet(state);
const normalBlocks = Selectors.normalBlocks(state); const normalBlocks = Selectors.normalBlocks(state);
const analyzerBlocks = Selectors.analyzerBlocks(state); const analyzerBlocks = Selectors.analyzerBlocks(state);
const obj = { const obj = {
experiments: exps, experiments: exps,
data: exps[ownProps.index] || getValidObj({name: '', contents: {}}, tc, [normalBlocks, ...analyzerBlocks]), data: data || getValidObj({name: '', contents: {}}, tc, [normalBlocks, ...analyzerBlocks]),
// algorithms for normal blocks // algorithms for normal blocks
normalBlocks, normalBlocks,
// algorithms for analyzer blocks // algorithms for analyzer blocks
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment