import { VOTING_STATE } from '../../../common/actionTypes/voting';

const votedState = (state = false, action) => {
  switch (action.type) {
    case VOTING_STATE:
      return {
        voted: action.data.voted,
      };

    default:
      return state;
  }
};

export default votedState;

import { OPEN_ISSUE } from '../../../common/actionTypes/issues';
import { VOTING_STATE } from '../../../common/actionTypes/voting';

const votedState = (state = false, action) => {
  switch (action.type) {
    case VOTING_STATE:
      return {
        voted: action.data.voted,
      };
    case OPEN_ISSUE:
      return {
        voted: false,
      };

    default:
      return state;
  }
};

export default votedState;

Set votedState upon ISSUE OPEN
Set votedState upon ISSUE OPEN
