Parcourir la source

rn: fix overriding user-selected server URL

Fixes: https://github.com/jitsi/jitsi-meet/issues/7373
master
Saúl Ibarra Corretgé il y a 5 ans
Parent
révision
16547b91a5
1 fichiers modifiés avec 8 ajouts et 5 suppressions
  1. 8
    5
      react/features/app/components/App.native.js

+ 8
- 5
react/features/app/components/App.native.js Voir le fichier

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

Chargement…
Annuler
Enregistrer