[RN] Detect errors when loading the configuration

The error is stored in the redux store in base/config so other components can
consult it. It is also broadcasted as a new event in the external API for the
SDK.
This commit is contained in:
Saúl Ibarra Corretgé
2017-09-06 16:31:14 -05:00
committed by Lyubo Marinov
parent 1d8ee9d32f
commit 284e4e543e
9 changed files with 78 additions and 3 deletions
@@ -10,6 +10,7 @@ import {
CONFERENCE_WILL_LEAVE,
JITSI_CONFERENCE_URL_KEY
} from '../../base/conference';
import { LOAD_CONFIG_ERROR } from '../../base/config';
import { MiddlewareRegistry } from '../../base/redux';
import { toURLString } from '../../base/util';
@@ -45,6 +46,16 @@ MiddlewareRegistry.register(store => next => action => {
_sendEvent(store, name, data);
break;
}
case LOAD_CONFIG_ERROR: {
const { type, error } = action;
_sendEvent(
store,
_getSymbolDescription(type),
{ error: String(error) });
break;
}
}
return result;