From 43030980b122bb9303f100bda5d472167ef22da6 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Fri, 12 Oct 2018 11:40:28 -0400 Subject: [PATCH] use cross-env for cd and make sure values are specified --- embark-ui/src/reducers/index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/embark-ui/src/reducers/index.js b/embark-ui/src/reducers/index.js index 54828583..91349113 100644 --- a/embark-ui/src/reducers/index.js +++ b/embark-ui/src/reducers/index.js @@ -130,7 +130,7 @@ function entities(state = entitiesDefaultState, action) { if (action[name] && action[name].length === 1) { let entity = action[name][0]; let nested = Object.keys(state).reduce((acc, entityName) => { - if (entity[entityName] && entity[entityName].length > 0) { + if (entity && entity[entityName] && entity[entityName].length > 0) { let entityFilter = filtrer[entityName] || (() => true); let entitySort = sorter[entityName] || (() => true); acc[entityName] = [...entity[entityName], ...state[entityName]].sort(entitySort).filter(entityFilter); @@ -156,7 +156,7 @@ function errorEntities(state = {}, action) { } let newState = {}; for (let name of Object.keys(entitiesDefaultState)) { - if (action[name] && action[name].length > 0) { + if (action[name] && action[name].length > 0 && action[name][0]) { newState[name] = action[name][0].error; } } diff --git a/package.json b/package.json index e50098c4..5a09b96f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "test:test_app": "cross-env DAPP=\"test_app\" npm run test_dapp", "test:contracts_app": "cross-env DAPP=\"contracts_app\" npm run test_dapp", "test_dapp": "cross-env-shell \"cd test_apps/$DAPP && npm install && npm test\"", - "prepublish": "cd embark-ui && npm install && npm run build && cd -" + "prepublish": "cross-env cd embark-ui && npm install && cd -" }, "bin": { "embark": "./bin/embark"