diff --git a/react/features/app/components/App.native.js b/react/features/app/components/App.native.js index 5b692ac182..00b255861b 100644 --- a/react/features/app/components/App.native.js +++ b/react/features/app/components/App.native.js @@ -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.