|
@@ -9,10 +9,11 @@ import {
|
9
|
9
|
SET_DYNAMIC_BRANDING_FAILED,
|
10
|
10
|
SET_DYNAMIC_BRANDING_READY
|
11
|
11
|
} from './actionTypes';
|
12
|
|
-import { extractFqnFromPath } from './functions';
|
|
12
|
+import { getDynamicBrandingUrl } from './functions';
|
13
|
13
|
|
14
|
14
|
const logger = getLogger(__filename);
|
15
|
15
|
|
|
16
|
+
|
16
|
17
|
/**
|
17
|
18
|
* Fetches custom branding data.
|
18
|
19
|
* If there is no data or the request fails, sets the `customizationReady` flag
|
|
@@ -23,15 +24,14 @@ const logger = getLogger(__filename);
|
23
|
24
|
export function fetchCustomBrandingData() {
|
24
|
25
|
return async function(dispatch: Function, getState: Function) {
|
25
|
26
|
const state = getState();
|
26
|
|
- const baseUrl = state['features/base/config'].brandingDataUrl;
|
27
|
27
|
const { customizationReady } = state['features/dynamic-branding'];
|
28
|
28
|
|
29
|
29
|
if (!customizationReady) {
|
30
|
|
- const fqn = extractFqnFromPath(state['features/base/connection'].locationURL.pathname);
|
|
30
|
+ const url = getDynamicBrandingUrl(state);
|
31
|
31
|
|
32
|
|
- if (baseUrl && fqn) {
|
|
32
|
+ if (url) {
|
33
|
33
|
try {
|
34
|
|
- const res = await doGetJSON(`${baseUrl}?conferenceFqn=${encodeURIComponent(fqn)}`);
|
|
34
|
+ const res = await doGetJSON(url);
|
35
|
35
|
|
36
|
36
|
return dispatch(setDynamicBrandingData(res));
|
37
|
37
|
} catch (err) {
|