Skip to content

Commit

Permalink
#455 Store and retrieve snapshot actions in/from the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriána Kohanová committed Nov 30, 2020
1 parent 4631505 commit 156565d
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions js/reducers/tracking/dispatchActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,10 @@ import {
} from '../../components/datasets/redux/actions';

export const saveCurrentActionsList = (snapshotID, projectID) => (dispatch, getState) => {
const state = getState();

let actionList = state.trackingReducers.track_actions_list;

if (!actionList || actionList.length === 0) {
Promise.resolve(dispatch(getTrackingActions(projectID))).then(response => {
actionList = response;
dispatch(saveActionsList(snapshotID, actionList));
});
} else {
Promise.resolve(dispatch(getTrackingActions(projectID))).then(response => {
let actionList = response;
dispatch(saveActionsList(snapshotID, actionList));
}
});
};

export const saveActionsList = (snapshotID, actionList) => (dispatch, getState) => {
Expand Down

0 comments on commit 156565d

Please sign in to comment.