From 1e18af2d1a67ec5161bc8a9e8602183eccf998e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Fri, 12 Jul 2019 15:55:38 +0200 Subject: [PATCH] rn: fix not showing a prompt when permissions have been denied This only shows up if we cannot prompt again, like when turning permissions off in the Settings app in iOS. --- react/features/base/tracks/actions.js | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/react/features/base/tracks/actions.js b/react/features/base/tracks/actions.js index f646f95bb..53cb65384 100644 --- a/react/features/base/tracks/actions.js +++ b/react/features/base/tracks/actions.js @@ -579,30 +579,9 @@ function _onCreateLocalTracksRejected({ gum }, device) { const { error } = gum; if (error) { - // FIXME For whatever reason (which is probably an - // implementation fault), react-native-webrtc will give the - // error in one of the following formats depending on whether it - // is attached to a remote debugger or not. (The remote debugger - // scenario suggests that react-native-webrtc is at fault - // because the remote debugger is Google Chrome and then its - // JavaScript engine will define DOMException. I suspect I wrote - // react-native-webrtc to return the error in the alternative - // format if DOMException is not defined.) - let trackPermissionError; - - switch (error.name) { - case 'DOMException': - trackPermissionError = error.message === 'NotAllowedError'; - break; - - case 'NotAllowedError': - trackPermissionError = error instanceof DOMException; - break; - } - dispatch({ type: TRACK_CREATE_ERROR, - permissionDenied: trackPermissionError, + permissionDenied: error.name === 'SecurityError', trackType: device }); }