Skip to content

Commit

Permalink
fix(deafen): Fix broken deafen/volume slider (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Lee committed Oct 22, 2021
1 parent 63e7875 commit bf777ce
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions store/audio/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ const mutations = {
},
deafen(state: AudioState) {
const isDeafened = state.deafened
state = {
...state,
previousVolume: isDeafened ? state.previousVolume : state.volume,
volume: isDeafened ? state.previousVolume : 0,
deafened: !isDeafened,
}
state.previousVolume = isDeafened ? state.previousVolume : state.volume
state.volume = isDeafened ? state.previousVolume : 0
state.deafened = !isDeafened
},
setVolume(state: AudioState, volume: Number) {
state.previousVolume = volume
Expand Down

0 comments on commit bf777ce

Please sign in to comment.