2017-04-23 20:14:02 +00:00
|
|
|
/* @flow */
|
|
|
|
|
2017-08-25 15:21:01 +00:00
|
|
|
import { LOAD_CONFIG_ERROR, SET_CONFIG } from './actionTypes';
|
|
|
|
|
|
|
|
/**
|
2017-09-06 23:26:33 +00:00
|
|
|
* Signals that a configuration could not be loaded due to a specific error.
|
2017-08-25 15:21:01 +00:00
|
|
|
*
|
2017-09-06 23:26:33 +00:00
|
|
|
* @param {Error} error - The {@code Error} which prevented the successful
|
|
|
|
* loading of a configuration.
|
|
|
|
* @param {string|URL} locationURL - The URL of the location which necessitated
|
|
|
|
* the loading of a configuration.
|
2017-08-25 15:21:01 +00:00
|
|
|
* @returns {{
|
2017-09-06 23:26:33 +00:00
|
|
|
* type: LOAD_CONFIG_ERROR,
|
|
|
|
* error: Error,
|
|
|
|
* locationURL
|
2017-08-25 15:21:01 +00:00
|
|
|
* }}
|
|
|
|
*/
|
2017-09-06 23:26:33 +00:00
|
|
|
export function loadConfigError(error: Error, locationURL: string | URL) {
|
2017-08-25 15:21:01 +00:00
|
|
|
return {
|
|
|
|
type: LOAD_CONFIG_ERROR,
|
2017-09-06 23:26:33 +00:00
|
|
|
error,
|
|
|
|
locationURL
|
2017-08-25 15:21:01 +00:00
|
|
|
};
|
|
|
|
}
|
2017-04-23 20:14:02 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the configuration represented by the feature base/config. The
|
|
|
|
* configuration is defined and consumed by the library lib-jitsi-meet but some
|
|
|
|
* of its properties are consumed by the application jitsi-meet as well.
|
|
|
|
*
|
|
|
|
* @param {Object} config - The configuration to be represented by the feature
|
|
|
|
* base/config.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_CONFIG,
|
|
|
|
* config: Object
|
|
|
|
* }}
|
|
|
|
*/
|
2017-08-25 12:51:57 +00:00
|
|
|
export function setConfig(config: Object = {}) {
|
2017-04-23 20:14:02 +00:00
|
|
|
return {
|
|
|
|
type: SET_CONFIG,
|
|
|
|
config
|
|
|
|
};
|
|
|
|
}
|