1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-29 05:58:30 +00:00

4.0.0-rc12.21

* Fixed: Merge User and Room objects when ID and login are both known at once.
* Fixed: Spacing and sorting of metadata beneath the player. (Closes %520)
* Fixed: Update the settings menu when new settings are added while the menu is open. (Closes #523)
* Fixed: Do not maximize or minimize the settings window when double-clicking in the search box. (Closes #521)
This commit is contained in:
SirStendec 2018-09-24 14:33:06 -04:00
parent 5aaa7773de
commit 8c0b4b8bad
11 changed files with 174 additions and 15 deletions

View file

@ -58,6 +58,11 @@ export default class MainMenu extends Module {
component: 'changelog'
});
this.on('settings:added-definition', (key, definition) => {
this._addDefinitionToTree(key, definition);
this.scheduleUpdate();
})
this.on('socket:command:new_version', version => {
if ( version === window.FrankerFaceZ.version_info.commit )
return;
@ -136,6 +141,35 @@ export default class MainMenu extends Module {
}
scheduleUpdate() {
if ( this._update_timer )
return;
this._update_timer = setTimeout(() => this.updateLiveMenu(), 250);
}
updateLiveMenu() {
clearTimeout(this._update_timer);
this._update_timer = null;
if ( ! this._vue || ! this._vue.$children || ! this._vue.$children[0] )
return;
const root = this._vue.$children[0],
item = root.currentItem,
key = item && item.full_key,
tree = this.getSettingsTree();
root.nav = tree;
root.nav_keys = tree.keys;
root.currentItem = tree.keys[key] || (this.has_update ?
tree.keys['home.changelog'] :
tree.keys['home']);
}
rebuildSettingsTree() {
this._settings_tree = {};
this._settings_count = 0;