fix(rn,tracks) fix not showing alert when permission is not granted

The error object changed its shape through time, adapt to the change.
pull/8705/head jitsi-meet_5592
Saúl Ibarra Corretgé 4 years ago committed by Saúl Ibarra Corretgé
parent b7b260f4c9
commit d93a402cc2
  1. 20
      react/features/base/tracks/actions.js

@ -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',
trackType: device
});
}
}
dispatch({
type: TRACK_CREATE_ERROR,
permissionDenied: error?.name === 'SecurityError',
trackType: device
});
};
}

Loading…
Cancel
Save