({ state, commit, rootGetters, dispatch })
| 136 | |
| 137 | actions: { |
| 138 | toggleCurriculumGuide ({ state, commit, rootGetters, dispatch }) { |
| 139 | if (state.visible) { |
| 140 | commit('closeCurriculumGuide') |
| 141 | } else { |
| 142 | if (!state.selectedCampaignId) { |
| 143 | const sortedCourses = rootGetters['courses/sorted'] || [] |
| 144 | if (sortedCourses[0]) { |
| 145 | // Ensure that the first course is automatically selected |
| 146 | dispatch('setSelectedCampaign', sortedCourses[0].campaignID) |
| 147 | } |
| 148 | } |
| 149 | commit('openCurriculumGuide') |
| 150 | } |
| 151 | }, |
| 152 | |
| 153 | setSelectedCampaign ({ state, commit, dispatch }, campaignID) { |
| 154 | commit('setSelectedCampaignId', campaignID) |
nothing calls this directly
no test coverage detected