From f5e66669314bc2fb6831d84cbf7700f566706f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Kn=C3=B6bel?= Date: Sun, 19 Jan 2020 01:04:02 +0100 Subject: [PATCH] fix microphone/sound device preselection --- src/components/profile/AudioPlaying.vue | 22 +++++++++++----------- src/components/profile/AudioRecording.vue | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/components/profile/AudioPlaying.vue b/src/components/profile/AudioPlaying.vue index f8c23fc7..3c9aba2a 100755 --- a/src/components/profile/AudioPlaying.vue +++ b/src/components/profile/AudioPlaying.vue @@ -108,7 +108,6 @@ }, data: function () { return { - device: '', speakers: {} } }, @@ -124,20 +123,21 @@ }, computed: { - devicePath: function() { - return 'sounds.' + this.profile.sounds.system + '.device' + device: { + get: function() { + if(this.profile.sounds[this.profile.sounds.system]) { + return this.profile.sounds[this.profile.sounds.system].device; + } + return ""; + }, + set: function(newValue) { + this.profile.sounds[this.profile.sounds.system].device = newValue; + } } }, mounted: function() { - this.getSpeakers() - this.device = this._.get(this.profile, this.devicePath, '') - }, - - watch: { - device: function() { - this._.set(this.profile, this.devicePath, this.device) - } + this.getSpeakers(); } } diff --git a/src/components/profile/AudioRecording.vue b/src/components/profile/AudioRecording.vue index efa4d2c5..fb550c65 100755 --- a/src/components/profile/AudioRecording.vue +++ b/src/components/profile/AudioRecording.vue @@ -173,7 +173,6 @@ }, data: function () { return { - device: '', microphones: {}, testing: false } @@ -217,20 +216,21 @@ }, computed: { - devicePath: function() { - return 'microphone.' + this.profile.microphone.system + '.device' + device: { + get: function() { + if(this.profile.microphone[this.profile.microphone.system]) { + return this.profile.microphone[this.profile.microphone.system].device; + } + return ""; + }, + set: function(newValue) { + this.profile.microphone[this.profile.microphone.system].device = newValue; + } } }, mounted: function() { - this.getMicrophones() - this.device = this._.get(this.profile, this.devicePath, '') - }, - - watch: { - device: function() { - this._.set(this.profile, this.devicePath, this.device) - } + this.getMicrophones(); } }