Skip to content

Commit

Permalink
feat(sounds): combine deafen/undeafen into one toggle control (#3218)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwoodland committed May 23, 2022
1 parent df6a013 commit e4be338
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 2 additions & 7 deletions components/views/settings/pages/audio/sounds/Sounds.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,14 @@
/>
<SettingsPagesAudioSoundsItem
:value="sound(Sounds.MUTE)"
@toggle="toggleSound(Sounds.MUTE, $event)"
@toggle="toggleSounds([Sounds.MUTE, Sounds.UNMUTE], $event)"
:title="$t('pages.settings.notifications.sounds.mute')"
/>
<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 e4be338

Please sign in to comment.