fix(rn,tracks) fix not showing alert when permission is not granted
The error object changed its shape through time, adapt to the change.
This commit is contained in:
parent
b7b260f4c9
commit
d93a402cc2
|
@ -598,26 +598,20 @@ function _disposeTracks(tracks) {
|
|||
* Implements the {@code Promise} rejection handler of
|
||||
* {@code createLocalTracksA} and {@code createLocalTracksF}.
|
||||
*
|
||||
* @param {Object} reason - The {@code Promise} rejection reason.
|
||||
* @param {Object} error - The {@code Promise} rejection reason.
|
||||
* @param {string} device - The device/{@code MEDIA_TYPE} associated with the
|
||||
* rejection.
|
||||
* @private
|
||||
* @returns {Function}
|
||||
*/
|
||||
function _onCreateLocalTracksRejected({ gum }, device) {
|
||||
function _onCreateLocalTracksRejected(error, device) {
|
||||
return dispatch => {
|
||||
// If permissions are not allowed, alert the user.
|
||||
if (gum) {
|
||||
const { error } = gum;
|
||||
|
||||
if (error) {
|
||||
dispatch({
|
||||
type: TRACK_CREATE_ERROR,
|
||||
permissionDenied: error.name === 'SecurityError',
|
||||
permissionDenied: error?.name === 'SecurityError',
|
||||
trackType: device
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue