You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-19 05:22:13 +03:00
Add a function to append/overwrite objects in the config on the fly
Intended to be used to overwrite settings which may be calculated rather than provided.
This commit is contained in:
@@ -41,6 +41,12 @@ class SdkConfig {
|
|||||||
static unset() {
|
static unset() {
|
||||||
global.mxReactSdkConfig = undefined;
|
global.mxReactSdkConfig = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static add(cfg) {
|
||||||
|
const liveConfig = SdkConfig.get();
|
||||||
|
const newConfig = Object.assign({}, liveConfig, cfg);
|
||||||
|
SdkConfig.put(newConfig);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = SdkConfig;
|
module.exports = SdkConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user