Skip to content

Commit

Permalink
feat(material): add UpdateAction in HideMaterialGroup action
Browse files Browse the repository at this point in the history
  • Loading branch information
AmyOrz committed Jan 3, 2019
1 parent d5d2c19 commit 8306319
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,13 @@ module Method = {

let component = ReasonReact.reducerComponent("MainEditorMaterial");

let reducer = (reduxTuple, currentSceneTreeNode, action, state) =>
let reducer =
(
(store, dispatchFunc) as reduxTuple,
currentSceneTreeNode,
action,
state,
) =>
switch (action) {
| ChangeMaterialType(value) =>
let sourceMaterialType = state.materialType;
Expand Down Expand Up @@ -190,8 +196,13 @@ let reducer = (reduxTuple, currentSceneTreeNode, action, state) =>
);
| ShowMaterialGroup =>
ReasonReact.Update({...state, isShowMaterialGroup: true})

| HideMaterialGroup =>
ReasonReact.Update({...state, isShowMaterialGroup: false})
ReasonReactUtils.updateWithSideEffects(
{...state, isShowMaterialGroup: false}, _state =>
dispatchFunc(AppStore.UpdateAction(Update([|UpdateStore.Inspector|])))
|> ignore
)
};

let _renderSelectMaterial = ({state, send}: ReasonReact.self('a, 'b, 'c)) =>
Expand Down

0 comments on commit 8306319

Please sign in to comment.