Fix mis-use of findIndex ( these really must be tested )
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import { fromJS } from "immutable"
|
import { fromJS } from "immutable"
|
||||||
import { fromJSOrdered, validateParam } from "core/utils"
|
import { fromJSOrdered, validateParam } from "core/utils"
|
||||||
import win from "../../window"
|
import win from "../../window"
|
||||||
import findIndex from "lodash/findIndex"
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
UPDATE_SPEC,
|
UPDATE_SPEC,
|
||||||
@@ -42,7 +41,7 @@ export default {
|
|||||||
[UPDATE_PARAM]: ( state, {payload} ) => {
|
[UPDATE_PARAM]: ( state, {payload} ) => {
|
||||||
let { path, paramName, value, isXml } = payload
|
let { path, paramName, value, isXml } = payload
|
||||||
return state.updateIn( [ "resolved", "paths", ...path, "parameters" ], fromJS([]), parameters => {
|
return state.updateIn( [ "resolved", "paths", ...path, "parameters" ], fromJS([]), parameters => {
|
||||||
const index = findIndex(parameters, p => p.get( "name" ) === paramName )
|
const index = parameters.findIndex(p => p.get( "name" ) === paramName )
|
||||||
if (!(value instanceof win.File)) {
|
if (!(value instanceof win.File)) {
|
||||||
value = fromJSOrdered( value )
|
value = fromJSOrdered( value )
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user