feat(dynamic-branding): get branding data from state
This commit is contained in:
parent
21cf7f23c2
commit
6df2e4009c
|
@ -22,7 +22,7 @@ export function fetchCustomBrandingData() {
|
|||
const { customizationReady } = state['features/dynamic-branding'];
|
||||
|
||||
if (!customizationReady) {
|
||||
const url = await getDynamicBrandingUrl();
|
||||
const url = await getDynamicBrandingUrl(state);
|
||||
|
||||
if (url) {
|
||||
try {
|
||||
|
|
|
@ -6,6 +6,7 @@ import {
|
|||
setDynamicBrandingFailed,
|
||||
setDynamicBrandingReady
|
||||
} from './actions.any';
|
||||
import { getDynamicBrandingUrl } from './functions.any';
|
||||
import logger from './logger';
|
||||
|
||||
|
||||
|
@ -19,7 +20,7 @@ import logger from './logger';
|
|||
export function fetchCustomBrandingData() {
|
||||
return async function(dispatch: Function, getState: Function) {
|
||||
const state = getState();
|
||||
const { dynamicBrandingUrl } = state['features/base/config'];
|
||||
const dynamicBrandingUrl = await getDynamicBrandingUrl(state);
|
||||
|
||||
if (dynamicBrandingUrl) {
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// @flow
|
||||
|
||||
import { loadConfig } from '../base/lib-jitsi-meet/functions';
|
||||
import { toState } from '../base/redux';
|
||||
|
||||
|
||||
/**
|
||||
* Extracts the fqn part from a path, where fqn represents
|
||||
|
@ -29,10 +30,13 @@ export function extractFqnFromPath(state?: Object) {
|
|||
/**
|
||||
* Returns the url used for fetching dynamic branding.
|
||||
*
|
||||
* @param {Object | Function} stateful - The redux store, state, or
|
||||
* {@code getState} function.
|
||||
* @returns {string}
|
||||
*/
|
||||
export async function getDynamicBrandingUrl() {
|
||||
const config = await loadConfig(window.location.href);
|
||||
export async function getDynamicBrandingUrl(stateful: Object | Function) {
|
||||
const state = toState(stateful);
|
||||
const config = state['features/base/config'];
|
||||
const { dynamicBrandingUrl } = config;
|
||||
|
||||
if (dynamicBrandingUrl) {
|
||||
|
|
Loading…
Reference in New Issue