Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(mobile/external-api): skip event if conference exists

paweldomasb2f76f3ed679
diff --git a/react/features/mobile/external-api/middleware.js b/react/features/mobile/external-api/middleware.js
index 64ae1c2412..6c0eda69e2 100644
--- a/react/features/mobile/external-api/middleware.js
+++ b/react/features/mobile/external-api/middleware.js
@@ -189,9 +189,9 @@ function _sendConferenceEvent(
/**
* Sends {@link CONFERENCE_FAILED} event when the {@link CONNECTION_FAILED}
- * occurs. Otherwise the external API will not emit such event, because at this
- * point conference has not been created yet and the base/conference feature
- * will not emit it.
+ * occurs. It should be done only if the connection fails before the conference
+ * instance is created. Otherwise the eventual failure event is supposed to be
+ * emitted by the base/conference feature.
*
* @param {Store} store - The redux store.
* @param {Action} action - The redux action.
@@ -199,8 +199,16 @@ function _sendConferenceEvent(
*/
function _sendConferenceFailedOnConnectionError(store, action) {
const { locationURL } = store.getState()['features/base/connection'];
+ const { connection } = action;
- locationURL && _sendEvent(
+ locationURL
+ && forEachConference(
+ store,
+
+ // If there's any conference in the base/conference state then the
+ // base/conference feature is supposed to emit a failure.
+ conference => conference.getConnection() !== connection)
+ && _sendEvent(
store,
_getSymbolDescription(CONFERENCE_FAILED),
/* data */ {