Skip to content

Commit d69b67e

Browse files
committed
load functionality will now properly populate actions, state and props on load
1 parent 6036266 commit d69b67e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/store/actions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,11 @@ const actions = {
277277

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

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

0 commit comments

Comments
 (0)