[RN] Handle config loading errors

They will be stored in redux and the PageReloadOverlay will be displayed.

Note that this commit also introduces a subtle (and yet important!) change:
the location URL is now always set, regardless of the configuration loading or
not. This is needed in order for the retry logic to pick it up.
This commit is contained in:
Saúl Ibarra Corretgé
2017-12-12 22:59:04 -06:00
committed by Lyubo Marinov
parent 87a87eebb9
commit c05c8e0f1e
5 changed files with 67 additions and 18 deletions
@@ -66,12 +66,14 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
*/
static needsRender(state) {
const conferenceError = state['features/base/conference'].error;
const configError = state['features/base/config'].error;
const connectionError = state['features/base/connection'].error;
return (
(connectionError && isFatalJitsiConnectionError(connectionError))
|| (conferenceError
&& isFatalJitsiConferenceError(conferenceError))
|| configError
);
}
@@ -253,10 +255,11 @@ export default class AbstractPageReloadOverlay extends Component<*, *> {
*/
export function abstractMapStateToProps(state: Object) {
const conferenceError = state['features/base/conference'].error;
const configError = state['features/base/config'].error;
const connectionError = state['features/base/connection'].error;
return {
isNetworkFailure: Boolean(connectionError),
reason: (connectionError || conferenceError).message
isNetworkFailure: Boolean(configError || connectionError),
reason: (configError || connectionError || conferenceError).message
};
}