MCPcopy Create free account
hub / github.com/codecombat/codecombat / toggleCurriculumGuide

Function toggleCurriculumGuide

ozaria/site/store/BaseCurriculumGuide.js:138–151  ·  view source on GitHub ↗
({ state, commit, rootGetters, dispatch })

Source from the content-addressed store, hash-verified

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)

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected