Skip to content

Commit fb7e830

Browse files
authored
Merge pull request #11 from oslabs-beta/bryan/fixLoadStateActionsProps
Bryan/fix load state actions props
2 parents 873fdbf + c8ef88a commit fb7e830

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/store/actions.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ const actions = {
277277

278278
// Loading ///////////////////////////////////////////////////////
279279

280-
[types.openProject]: ({ commit }, payload) => {
281-
// open project imagePath, componentPath, routePath
280+
[types.openProject]: ({ commit, state }, payload) => {
281+
payload.userProps.forEach((prop)=>{commit(types.CREATE_PROP, prop)})
282+
payload.userActions.forEach((action)=>{commit(types.CREATE_ACTION, action)})
283+
payload.userState.forEach((state)=>{commit(types.CREATE_STATE, state)})
282284
commit(types.SET_IMAGE_PATH, payload.imagePath);
283285
commit(types.SET_COMPONENT_MAP, payload.componentMap);
284286
commit(types.SET_ROUTES, payload.routes);

0 commit comments

Comments
 (0)