Преглед на файлове

feat(recent-list): fix undefined error that breaks visitor joining (#14024)

* feat(recent-list): fix undefined error that breaks visitor joining

* feat(recent-list): revert variable name change

* feat(recent-list): fixed linter
factor2
Calinteodor преди 1 година
родител
ревизия
2a3c962e88
No account linked to committer's email address
променени са 1 файла, в които са добавени 9 реда и са изтрити 4 реда
  1. 9
    4
      react/features/recent-list/middleware.ts

+ 9
- 4
react/features/recent-list/middleware.ts Целия файл

@@ -83,7 +83,8 @@ function _appWillMount({ dispatch, getState }: IStore, next: Function, action: A
83 83
  * @returns {*} The result returned by {@code next(action)}.
84 84
  */
85 85
 function _conferenceWillLeave({ dispatch, getState }: IStore, next: Function, action: AnyAction) {
86
-    const { doNotStoreRoom } = getState()['features/base/config'];
86
+    const state = getState();
87
+    const { doNotStoreRoom } = state['features/base/config'];
87 88
 
88 89
     if (!doNotStoreRoom && !inIframe()) {
89 90
         let locationURL;
@@ -100,13 +101,17 @@ function _conferenceWillLeave({ dispatch, getState }: IStore, next: Function, ac
100 101
          * JITSI_CONFERENCE_URL_KEY so we cannot call it and must use the other way.
101 102
          */
102 103
         if (typeof APP === 'undefined') {
103
-            locationURL = action.conference[JITSI_CONFERENCE_URL_KEY];
104
+            const { conference } = action;
105
+
106
+            // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
107
+            locationURL = conference && conference[JITSI_CONFERENCE_URL_KEY];
104 108
         } else {
105
-            locationURL = getState()['features/base/connection'].locationURL;
109
+            locationURL = state['features/base/connection'].locationURL;
106 110
         }
107 111
         dispatch(
108 112
             _updateConferenceDuration(
109
-                locationURL));
113
+                locationURL
114
+            ));
110 115
     }
111 116
 
112 117
     return next(action);

Loading…
Отказ
Запис