Saving settings after changing redundant headset doesn't remove them immediately.
To reproduce: set a usb device as your audio device(s) in Vialer-js settings and save. Remove the device. You'll be redirected to the audio settings tab and a warning shows that the device is removed/invalid. Change to a different device. The redundant device should be removed on save immediately. What actually happens is that you have to save again, before the device is removed.
Approach
Settings weren't always saved when the bg:devices:verify-sinks event was emitted. Moved the emission of the event in the callback to solve it.
Purpose
Saving settings after changing redundant headset doesn't remove them immediately.
To reproduce: set a usb device as your audio device(s) in Vialer-js settings and save. Remove the device. You'll be redirected to the audio settings tab and a warning shows that the device is removed/invalid. Change to a different device. The redundant device should be removed on save immediately. What actually happens is that you have to save again, before the device is removed.
Approach
Settings weren't always saved when the
bg:devices:verify-sinks
event was emitted. Moved the emission of the event in the callback to solve it.