Fix build

This commit is contained in:
uwap 2018-01-19 21:57:20 +01:00
parent 8d2d39cb0e
commit 3ed861369e
2 changed files with 11 additions and 2 deletions

View file

@ -14,6 +14,7 @@ import { MenuItem } from "material-ui/Menu";
import Button from "material-ui/Button";
import keyOf from "utils/keyOf";
import { getInternals, getActuals } from "utils/state";
type UiItemProps<I> = {
item: I,
@ -45,8 +46,8 @@ export default class UiItem<I:Object> extends React.Component<UiItemProps<I>> {
typeof this.props.item.enableCondition == "function") {
const enableCondition = this.props.item.enableCondition;
const state = this.props.state;
const internals = _.mapValues(state, (x) => x.internal);
const actuals = _.mapValues(state, (x) => x.actual);
const internals = getInternals(state);
const actuals = getActuals(state);
return enableCondition(internals, actuals, state);
} else {
return true;

8
src/utils/state.js Normal file
View file

@ -0,0 +1,8 @@
// @flow
import _ from "lodash";
export const getInternals = (state: State): Map<string, Internal> =>
_.mapValues(state, (x) => x.internal || x.actual);
export const getActuals = (state: State): Map<string, Actual> =>
_.mapValues(state, (x) => x.actual);