import actionTypes from '../constants';

const initialState = {
  canManageLessonPlan: false,
  milestonesExpanded: 'all',
};

export default function (state = initialState, action) {
  const { type } = action;

  switch (type) {
    case actionTypes.LOAD_LESSON_PLAN_SUCCESS: {
      return { ...state, ...action.flags };
    }
    default:
      return state;
  }
}

import actionTypes from '../constants';

export const initialState = {
  canManageLessonPlan: false,
  milestonesExpanded: 'current',
};

export default function (state = initialState, action) {
  const { type } = action;

  switch (type) {
    case actionTypes.LOAD_LESSON_PLAN_SUCCESS: {
      const nextState = { ...state, ...action.flags };
      if (!nextState.milestonesExpanded) {
        nextState.milestonesExpanded = initialState.milestonesExpanded;
      }
      return nextState;
    }
    default:
      return state;
  }
}

Change default milestonesExpanded setting to `current`
Change default milestonesExpanded setting to `current`
