Local echo on all setting levels

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston 2017-11-04 20:32:00 -07:00
parent 3958e32672
commit 8351ec7e73
2 changed files with 73 additions and 0 deletions

View file

@ -25,6 +25,7 @@ import ConfigSettingsHandler from "./ConfigSettingsHandler";
import {_t} from '../languageHandler';
import SdkConfig from "../SdkConfig";
import {SETTINGS} from "./Settings";
import LocalEchoWrapper from "./LocalEchoWrapper";
/**
* Represents the various setting levels supported by the SettingsStore.
@ -59,6 +60,11 @@ const LEVEL_HANDLERS = {
"default": new DefaultSettingsHandler(defaultSettings),
};
// Wrap all the handlers with local echo
for (const key of Object.keys(LEVEL_HANDLERS)) {
LEVEL_HANDLERS[key] = new LocalEchoWrapper(LEVEL_HANDLERS[key]);
}
const LEVEL_ORDER = [
'device', 'room-device', 'room-account', 'account', 'room', 'config', 'default',
];