ソースを参照

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

The error object changed its shape through time, adapt to the change.
master
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
 

読み込み中…
キャンセル
保存