InFact-coop / BlueCross

Helping to match dogs with new owners!
https://newhome.bluecross.org.uk
MIT License
1 stars 1 forks source link

Take Photo option shows on browsers without native support #163

Closed maxgerber closed 6 years ago

maxgerber commented 6 years ago

Problem: The "Take Photo" button in the Photos of Rex view still displays regardless of whether or not the browser has the capacity to use the underlying mediadevices.getUserMedia API.

Cause: We aren't checking whether or not getUserMedia exists as an API in our photos.js file

Solution: We should create a new port checking for the existence of getUserMedia on UrlChange to "/#photos". We should return a boolean value to Elm which we will pipe directly into the model, and conditionally render using the displayElement helper.