Parcourir la source

[RN] Don't process invite events if the external API scope doesn't match

This can happen if there are multiple JitsiMeetView instances are active at the
same time, because there is a single bridge, which means all of them would get
the events.
master
Saúl Ibarra Corretgé il y a 7 ans
Parent
révision
552fadc4a4
1 fichiers modifiés avec 16 ajouts et 1 suppressions
  1. 16
    1
      react/features/invite/middleware.native.js

+ 16
- 1
react/features/invite/middleware.native.js Voir le fichier

@@ -139,6 +139,14 @@ function _onInvite(
139 139
         { addPeopleControllerScope, externalAPIScope, invitees }) {
140 140
     const { getState } = this; // eslint-disable-line no-invalid-this
141 141
     const state = getState();
142
+
143
+    // If there are multiple JitsiMeetView instances alive, they will all get
144
+    // the event, since there is a single bridge, so make sure we don't act if
145
+    // the event is not for us.
146
+    if (state['features/app'].app.props.externalAPIScope !== externalAPIScope) {
147
+        return;
148
+    }
149
+
142 150
     const { conference } = state['features/base/conference'];
143 151
     const { inviteServiceUrl } = state['features/base/config'];
144 152
     const options = {
@@ -167,8 +175,15 @@ function _onInvite(
167 175
 function _onPerformQuery(
168 176
         { addPeopleControllerScope, externalAPIScope, query }) {
169 177
     const { getState } = this; // eslint-disable-line no-invalid-this
170
-
171 178
     const state = getState();
179
+
180
+    // If there are multiple JitsiMeetView instances alive, they will all get
181
+    // the event, since there is a single bridge, so make sure we don't act if
182
+    // the event is not for us.
183
+    if (state['features/app'].app.props.externalAPIScope !== externalAPIScope) {
184
+        return;
185
+    }
186
+
172 187
     const {
173 188
         dialOutAuthUrl,
174 189
         peopleSearchQueryTypes,

Chargement…
Annuler
Enregistrer