瀏覽代碼

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

The error object changed its shape through time, adapt to the change.
j8
Saúl Ibarra Corretgé 4 年之前
父節點
當前提交
d93a402cc2
共有 1 個檔案被更改,包括 7 行新增13 行删除
  1. 7
    13
      react/features/base/tracks/actions.js

+ 7
- 13
react/features/base/tracks/actions.js 查看文件

@@ -598,26 +598,20 @@ function _disposeTracks(tracks) {
598 598
  * Implements the {@code Promise} rejection handler of
599 599
  * {@code createLocalTracksA} and {@code createLocalTracksF}.
600 600
  *
601
- * @param {Object} reason - The {@code Promise} rejection reason.
601
+ * @param {Object} error - The {@code Promise} rejection reason.
602 602
  * @param {string} device - The device/{@code MEDIA_TYPE} associated with the
603 603
  * rejection.
604 604
  * @private
605 605
  * @returns {Function}
606 606
  */
607
-function _onCreateLocalTracksRejected({ gum }, device) {
607
+function _onCreateLocalTracksRejected(error, device) {
608 608
     return dispatch => {
609 609
         // If permissions are not allowed, alert the user.
610
-        if (gum) {
611
-            const { error } = gum;
612
-
613
-            if (error) {
614
-                dispatch({
615
-                    type: TRACK_CREATE_ERROR,
616
-                    permissionDenied: error.name === 'SecurityError',
617
-                    trackType: device
618
-                });
619
-            }
620
-        }
610
+        dispatch({
611
+            type: TRACK_CREATE_ERROR,
612
+            permissionDenied: error?.name === 'SecurityError',
613
+            trackType: device
614
+        });
621 615
     };
622 616
 }
623 617
 

Loading…
取消
儲存