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

Function muteTrack

app/core/store/modules/audio.js:554–565  ·  view source on GitHub ↗

* Mutes a track regardless of current mute state. Maintains volume * settings on sounds. * * @param track {string} track to mute * * @return Array of sound IDs that were muted * * @throws {Error} when invalid track specified

({ state, dispatch, commit }, track)

Source from the content-addressed store, hash-verified

552 * @throws {Error} when invalid track specified
553 */
554 muteTrack ({ state, dispatch, commit }, track) {
555 const trackData = state.tracks[track]
556 if (!trackData) {
557 throw new Error('Invalid track specified')
558 }
559
560 const mutes = Array.from(trackData.keys())
561 .map(id => dispatch('muteSound', id))
562
563 commit('setMute', { track, muted: true })
564 return Promise.all(mutes)
565 },
566
567 /**
568 * Unmutes a track regardless of current mute state. Maintains volume

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected