rn: fix overriding user-selected server URL

Fixes: https://github.com/jitsi/jitsi-meet/issues/7373
This commit is contained in:
Saúl Ibarra Corretgé 2020-07-22 12:50:10 +02:00 committed by Saúl Ibarra Corretgé
parent 1e3e15fc72
commit 16547b91a5
1 changed files with 8 additions and 5 deletions

View File

@ -4,7 +4,9 @@ import React from 'react';
import { setColorScheme } from '../../base/color-scheme';
import { DialogContainer } from '../../base/dialog';
import { CALL_INTEGRATION_ENABLED, SERVER_URL_CHANGE_ENABLED, updateFlags } from '../../base/flags';
import { updateFlags } from '../../base/flags/actions';
import { CALL_INTEGRATION_ENABLED, SERVER_URL_CHANGE_ENABLED } from '../../base/flags/constants';
import { getFeatureFlag } from '../../base/flags/functions';
import { Platform } from '../../base/react';
import { DimensionsDetector, clientResized } from '../../base/responsive-ui';
import { updateSettings } from '../../base/settings';
@ -83,11 +85,14 @@ export class App extends AbstractApp {
super.componentDidMount();
this._init.then(() => {
const { dispatch, getState } = this.state.store;
// We set these early enough so then we avoid any unnecessary re-renders.
const { dispatch } = this.state.store;
dispatch(setColorScheme(this.props.colorScheme));
dispatch(updateFlags(this.props.flags));
// Check if serverURL is configured externally and not allowed to change.
const serverURLChangeEnabled = this.props.flags[SERVER_URL_CHANGE_ENABLED];
const serverURLChangeEnabled = getFeatureFlag(getState(), SERVER_URL_CHANGE_ENABLED, true);
if (!serverURLChangeEnabled) {
// As serverURL is provided externally, so we push it to settings.
@ -100,8 +105,6 @@ export class App extends AbstractApp {
}
}
dispatch(setColorScheme(this.props.colorScheme));
dispatch(updateFlags(this.props.flags));
dispatch(updateSettings(this.props.userInfo || {}));
// Update settings with feature-flag.