diff --git a/src/experiments.json b/src/experiments.json index 8dea498d..257f9b09 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -3,8 +3,8 @@ "name": "New API Stress Testing", "description": "Send duplicate requests to the new API server for load testing.", "groups": [ - {"value": true, "weight": 0}, - {"value": false, "weight": 100} + {"value": true, "weight": 25}, + {"value": false, "weight": 75} ] } } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 10893c05..74780add 100644 --- a/src/main.js +++ b/src/main.js @@ -100,7 +100,7 @@ class FrankerFaceZ extends Module { FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 0, revision: 0, extra: '-rc12.9', + major: 4, minor: 0, revision: 0, extra: '-rc12.10', commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/modules/chat/room.js b/src/modules/chat/room.js index 0c36cf40..818bae5f 100644 --- a/src/modules/chat/room.js +++ b/src/modules/chat/room.js @@ -189,7 +189,7 @@ export default class Room { if ( this.manager.experiments.getAssignment('api_load') ) try { - fetch(`${NEW_API}/v1/rooms/${this.id ? `id/${this.id}` : this.login}`).catch(() => {}); + fetch(`${NEW_API}/v1/room/${this.id ? `id/${this.id}` : this.login}`).catch(() => {}); } catch(err) { /* do nothing */ } let response, data; diff --git a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx index 06dd92be..44a2b898 100644 --- a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx +++ b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx @@ -440,8 +440,21 @@ export default class EmoteMenu extends Module { constructor(props) { super(props); + this.ref = null; + this.saveRef = ref => { + if ( this.ref ) + this.props.stopObserving(this.ref); + + this.ref = ref; + if ( ref ) + this.props.startObserving(this.ref, this); + } + const collapsed = storage.get('emote-menu.collapsed') || []; - this.state = {collapsed: props.data && collapsed.includes(props.data.key)} + this.state = { + collapsed: props.data && collapsed.includes(props.data.key), + intersecting: window.IntersectionObserver ? false : true + } this.clickHeading = this.clickHeading.bind(this); this.clickEmote = this.clickEmote.bind(this); @@ -450,6 +463,16 @@ export default class EmoteMenu extends Module { this.onMouseLeave = this.onMouseLeave.bind(this); } + componentDidMount() { + if ( this.ref ) + this.props.startObserving(this.ref, this); + } + + componentWillUnmount() { + if ( this.ref ) + this.props.stopObserving(this.ref); + } + clickEmote(event) { if ( t.emotes.handleClick(event) ) return; @@ -534,7 +557,7 @@ export default class EmoteMenu extends Module { } } - return (
+ return (
{show_heading ? ( {image}
@@ -584,6 +607,9 @@ export default class EmoteMenu extends Module { } renderEmote(emote, locked, source, sellout) { + if ( ! this.state.intersecting ) + return ; + return (