mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-31 23:16:09 +02:00
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:
parent
1870db7d38
commit
4aab8224ed
8 changed files with 275 additions and 242 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue