Quellcode durchsuchen

fix(jaas): Get dynamic branding url from config file

We make the request for dynamic branding as soon as possible so
at the time of the request the config is not yet added to the store.
In order to fix this we get the jass brandingDataUrl &
dynamicBrandingUrl directly from the config.
master
Vlad Piersec vor 3 Jahren
Ursprung
Commit
ddcb85a1d8

+ 1
- 1
react/features/dynamic-branding/actions.js Datei anzeigen

27
         const { customizationReady } = state['features/dynamic-branding'];
27
         const { customizationReady } = state['features/dynamic-branding'];
28
 
28
 
29
         if (!customizationReady) {
29
         if (!customizationReady) {
30
-            const url = getDynamicBrandingUrl(state);
30
+            const url = await getDynamicBrandingUrl();
31
 
31
 
32
             if (url) {
32
             if (url) {
33
                 try {
33
                 try {

+ 5
- 4
react/features/dynamic-branding/functions.js Datei anzeigen

1
 // @flow
1
 // @flow
2
+import { loadConfig } from '../base/lib-jitsi-meet';
2
 
3
 
3
 /**
4
 /**
4
  * Extracts the fqn part from a path, where fqn represents
5
  * Extracts the fqn part from a path, where fqn represents
17
 /**
18
 /**
18
  * Returns the url used for fetching dynamic branding.
19
  * Returns the url used for fetching dynamic branding.
19
  *
20
  *
20
- * @param {Object} state - The state of the app.
21
  * @returns {string}
21
  * @returns {string}
22
  */
22
  */
23
-export function getDynamicBrandingUrl(state: Object) {
24
-    const { dynamicBrandingUrl } = state['features/base/config'];
23
+export async function getDynamicBrandingUrl() {
24
+    const config = await loadConfig(window.location.href);
25
+    const { dynamicBrandingUrl } = config;
25
 
26
 
26
     if (dynamicBrandingUrl) {
27
     if (dynamicBrandingUrl) {
27
         return dynamicBrandingUrl;
28
         return dynamicBrandingUrl;
28
     }
29
     }
29
 
30
 
30
-    const baseUrl = state['features/base/config'].brandingDataUrl;
31
+    const { brandingDataUrl: baseUrl } = config;
31
     const fqn = extractFqnFromPath();
32
     const fqn = extractFqnFromPath();
32
 
33
 
33
     if (baseUrl && fqn) {
34
     if (baseUrl && fqn) {

Laden…
Abbrechen
Speichern