1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-31 23:18:31 +00:00

4.0.0-rc18.2

More performance!

* Changed: Push the chat scroll to bottom into a new animation frame to avoid costly recalculations as much as possible.
* Fixed: Runaway performance issue when using FontAwesome icons for in-line chat actions due to an overabundance of CSS.
* Fixed: Emitting updated events for settings that haven't changed, resulting in frequent re-rendering of all chat lines.
This commit is contained in:
SirStendec 2019-04-30 15:18:29 -04:00
parent 918a5fbb13
commit 8bc25b8d5f
7 changed files with 182 additions and 15 deletions

View file

@ -6,7 +6,7 @@
import {ColorAdjuster} from 'utilities/color';
import {setChildren} from 'utilities/dom';
import {has, make_enum, split_chars, shallow_object_equals} from 'utilities/object';
import {has, make_enum, split_chars, shallow_object_equals, set_equals} from 'utilities/object';
import {FFZEvent} from 'utilities/events';
import Module from 'utilities/module';
@ -1454,6 +1454,21 @@ export default class ChatHook extends Module {
if ( ! room )
return;
// We have to check that the available cheers haven't changed
// to avoid doing too many recalculations.
let new_bits = null;
if ( config && Array.isArray(config.orderedActions) ) {
new_bits = new Set;
for(const action of config.orderedActions)
if ( action && action.prefix )
new_bits.add(action.prefix);
}
if ( (! this._ffz_old_bits && ! new_bits) || set_equals(this._ffz_old_bits, new_bits) )
return;
this._ffz_old_bits = new_bits;
room.updateBitsConfig(formatBitsConfig(config));
this.updateChatLines();
}