diff --git a/src/main.js b/src/main.js index 10616d76..1b10ee9f 100644 --- a/src/main.js +++ b/src/main.js @@ -149,7 +149,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}` FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 0, revision: 0, extra: '-rc21.2', + major: 4, minor: 0, revision: 0, extra: '-rc21.3', commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/sites/twitch-twilight/modules/chat/index.js b/src/sites/twitch-twilight/modules/chat/index.js index fd3548e8..17bb29c1 100644 --- a/src/sites/twitch-twilight/modules/chat/index.js +++ b/src/sites/twitch-twilight/modules/chat/index.js @@ -359,13 +359,13 @@ export default class ChatHook extends Module { updateChatCSS() { - if ( ! this._update_chat_css_timer ) - this._update_chat_css_timer = setTimeout(() => this._updateChatCSS(), 0); + if ( ! this._update_css_waiter ) + this._update_css_waiter = requestAnimationFrame(() => this._updateChatCSS()); } _updateChatCSS() { - clearTimeout(this._update_chat_css_timer); - this._update_chat_css_timer = null; + cancelAnimationFrame(this._update_css_waiter); + this._update_css_waiter = null; const width = this.chat.context.get('chat.width'), size = this.chat.context.get('chat.font-size'), @@ -438,8 +438,8 @@ export default class ChatHook extends Module { this.on('site.web_munch:loaded', this.grabTypes); this.grabTypes(); - this.settings.on('changed:chat.width', this.updateChatCSS, this); - this.chat.context.on('changed:chat.use-width', this.updateChatCSS, this); + this.chat.context.on('changed:chat.width', this.updateChatCSS, this); + this.settings.on('changed:chat.use-width', this.updateChatCSS, this); this.chat.context.on('changed:chat.font-size', this.updateChatCSS, this); this.chat.context.on('changed:chat.font-family', this.updateChatCSS, this); this.chat.context.on('changed:chat.lines.emote-alignment', this.updateChatCSS, this);