瀏覽代碼

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.
master
Saúl Ibarra Corretgé 6 年之前
父節點
當前提交
1e18af2d1a
共有 1 個檔案被更改,包括 1 行新增22 行删除
  1. 1
    22
      react/features/base/tracks/actions.js

+ 1
- 22
react/features/base/tracks/actions.js 查看文件

@@ -579,30 +579,9 @@ function _onCreateLocalTracksRejected({ gum }, device) {
579 579
             const { error } = gum;
580 580
 
581 581
             if (error) {
582
-                // FIXME For whatever reason (which is probably an
583
-                // implementation fault), react-native-webrtc will give the
584
-                // error in one of the following formats depending on whether it
585
-                // is attached to a remote debugger or not. (The remote debugger
586
-                // scenario suggests that react-native-webrtc is at fault
587
-                // because the remote debugger is Google Chrome and then its
588
-                // JavaScript engine will define DOMException. I suspect I wrote
589
-                // react-native-webrtc to return the error in the alternative
590
-                // format if DOMException is not defined.)
591
-                let trackPermissionError;
592
-
593
-                switch (error.name) {
594
-                case 'DOMException':
595
-                    trackPermissionError = error.message === 'NotAllowedError';
596
-                    break;
597
-
598
-                case 'NotAllowedError':
599
-                    trackPermissionError = error instanceof DOMException;
600
-                    break;
601
-                }
602
-
603 582
                 dispatch({
604 583
                     type: TRACK_CREATE_ERROR,
605
-                    permissionDenied: trackPermissionError,
584
+                    permissionDenied: error.name === 'SecurityError',
606 585
                     trackType: device
607 586
                 });
608 587
             }

Loading…
取消
儲存