summaryrefslogtreecommitdiff
path: root/frontend/site/audio/audio.reducer.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/site/audio/audio.reducer.js')
-rw-r--r--frontend/site/audio/audio.reducer.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/frontend/site/audio/audio.reducer.js b/frontend/site/audio/audio.reducer.js
index f0bf0e9..9cdda54 100644
--- a/frontend/site/audio/audio.reducer.js
+++ b/frontend/site/audio/audio.reducer.js
@@ -3,6 +3,7 @@ import * as types from 'site/types'
const initialState = {
player: new AudioPlayer(),
+ muted: false,
}
export default function audioReducer(state = initialState, action) {
@@ -12,6 +13,20 @@ export default function audioReducer(state = initialState, action) {
state.player.load(action.data.graph)
return state
+ case types.site.mute_audio:
+ state.player.toggleMuted(true)
+ return {
+ ...state,
+ muted: true,
+ }
+
+ case types.site.unmute_audio:
+ state.player.toggleMuted(false)
+ return {
+ ...state,
+ muted: false,
+ }
+
default:
return state
}