Fix incorrect logic in saving bluetooth setting

This commit is contained in:
Aleksandras Kostarevas 2024-07-01 14:51:24 +03:00
parent 798a8f0b5e
commit 1f99878e2b

View File

@ -217,13 +217,13 @@ private class VoiceInputActionWindow(
override fun recordingStarted(device: MicrophoneDeviceState) {
if (shouldPlaySounds) {
state.soundPlayer.playStartSound()
}
// Only set the setting if bluetooth is available, else it would reset the setting
// every time it's used without a bluetooth device connected.
if(device.bluetoothAvailable) {
manager.getLifecycleScope().launch {
context.setSetting(PREFER_BLUETOOTH, device.bluetoothActive)
}
// Only set the setting if bluetooth is available, else it would reset the setting
// every time it's used without a bluetooth device connected.
if(device.bluetoothAvailable) {
manager.getLifecycleScope().launch {
context.setSetting(PREFER_BLUETOOTH, device.bluetoothActive)
}
}
}