Skip to content

Commit

Permalink
feat(sounds): combine deafen/undeafen into one toggle control
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoodland authored and josephmcg committed May 23, 2022
1 parent c1de4c1 commit 866ef29
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 1 addition & 6 deletions components/views/settings/pages/audio/sounds/Sounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@
/>
<SettingsPagesAudioSoundsItem
:value="sound(Sounds.DEAFEN)"
@toggle="toggleSound(Sounds.DEAFEN, $event)"
@toggle="toggleSounds([Sounds.DEAFEN, Sounds.UNDEAFEN], $event)"
:title="$t('pages.settings.notifications.sounds.deafen')"
/>
<SettingsPagesAudioSoundsItem
:value="sound(Sounds.UNDEAFEN)"
@toggle="toggleSound(Sounds.UNDEAFEN, $event)"
:title="$t('pages.settings.notifications.sounds.undeafen')"
/>
<SettingsPagesAudioSoundsItem
:value="sound(Sounds.UPLOAD)"
@toggle="toggleSound(Sounds.UPLOAD, $event)"
Expand Down
5 changes: 5 additions & 0 deletions components/views/settings/pages/audio/sounds/Sounds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ export default Vue.extend({
toggleSound(key: Sounds, value: boolean) {
this.$store.commit('sounds/set', { key, value })
},
toggleSounds(keys: Sounds[], value: boolean) {
for (const key of keys) {
this.$store.commit('sounds/set', { key, value })
}
},
},
})
</script>
Expand Down

0 comments on commit 866ef29

Please sign in to comment.