Skip to content

Commit

Permalink
Fix: 音声の再生デバイスを選択できなくなっていたリグレッションを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukumijima committed Dec 3, 2024
1 parent 4092d37 commit 683ce25
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/Dialog/SettingDialog/SettingDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -679,23 +679,29 @@ const [
const canSetAudioOutputDevice = computed(() => {
return !!HTMLAudioElement.prototype.setSinkId;
});
const currentAudioOutputDeviceComputed = computed<string | undefined>({
const currentAudioOutputDeviceComputed = computed<
| {
key: string;
label: string;
}
| undefined
>({
get: () => {
// 再生デバイスが見つからなかったらデフォルト値に戻す
// FIXME: watchなどにしてgetter内で操作しないようにする
const device = availableAudioOutputDevices.value?.find(
(device) => device.key === store.state.savingSetting.audioOutputDevice,
);
if (device) {
return device.key;
return device;
} else if (store.state.savingSetting.audioOutputDevice !== "default") {
handleSavingSettingChange("audioOutputDevice", "default");
}
return undefined;
},
set: (device) => {
if (device) {
handleSavingSettingChange("audioOutputDevice", device);
handleSavingSettingChange("audioOutputDevice", device.key);
}
},
});
Expand Down

0 comments on commit 683ce25

Please sign in to comment.