Initial version of hot-reload of config, menus, and prompts
* Themes use ES6 Map vs object{}
* Re-write and re-enable config cache using sane
* Events sent for config, prompt, or menu changes
* Event sent for theme changes
* Theme (or parent menu/prompt) changes cause re-merge and updates to connected clients
This commit is contained in:
@@ -38,6 +38,7 @@ const User = require('./user.js');
|
||||
const Config = require('./config.js').config;
|
||||
const MenuStack = require('./menu_stack.js');
|
||||
const ACS = require('./acs.js');
|
||||
const Events = require('./events.js');
|
||||
|
||||
// deps
|
||||
const stream = require('stream');
|
||||
@@ -110,6 +111,12 @@ function Client(/*input, output*/) {
|
||||
this.input.on('data', this.dataHandler);
|
||||
};
|
||||
|
||||
Events.on(Events.getSystemEvents().ThemeChanged, ( { themeId } ) => {
|
||||
if(_.get(this.currentTheme, 'info.themeId') === themeId) {
|
||||
this.currentTheme = require('./theme.js').getAvailableThemes().get(themeId);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//
|
||||
// Peek at incoming |data| and emit events for any special
|
||||
|
||||
Reference in New Issue
Block a user