vialer / vialer-js

Pluggable WebRTC softphone and communication platform.
MIT License
1k stars 60 forks source link

VIALJS-112: Fixed issues with the timing of saving settings and the verify-sinks bg call. #194

Closed c0deaddict closed 6 years ago

c0deaddict commented 6 years ago

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.