Ensure that volume is always a Number #493
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes the issue where the volume is set to the maximum volume when setting a random volume by clicking the slider and then invoking the volume up action. The reason for this is that the slider apparently sets the volume to a string '100' instead of a number, and in turn the volume up concatenates the current volume with 2 instead of adding 2. As a result, the volume is set to 100 (minimum of
__2
and100
) instead of the expected volume. This doesn't apply to the volume down action becausestring - number = number
. Obviously…Forcing the saved volume to always be a number resolves this issue. Additionally, we also don't allow setting the volume to any falsy/undefined value anymore.