diff --git a/package.json b/package.json index 241c4c68..112b38df 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.55.0", + "version": "4.55.1", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/clips.js b/src/clips.js index 883d1883..60a9992a 100644 --- a/src/clips.js +++ b/src/clips.js @@ -13,6 +13,7 @@ import SettingsManager from './settings/index'; import AddonManager from './addons'; import ExperimentManager from './experiments'; import {TranslationManager} from './i18n'; +import PubSubClient from './pubsub'; import StagingSelector from './staging'; import LoadTracker from './load_tracker'; @@ -59,6 +60,7 @@ class FrankerFaceZ extends Module { this.inject('i18n', TranslationManager); this.inject('staging', StagingSelector); this.inject('load_tracker', LoadTracker); + this.inject('pubsub', PubSubClient); this.inject('site', Site); this.inject('addons', AddonManager); diff --git a/src/experiments.json b/src/experiments.json index f1ae351d..a7fc6a85 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -19,8 +19,8 @@ "name": "MQTT-Based PubSub", "description": "An experimental new pubsub system that should be more reliable than the existing socket cluster.", "groups": [ - {"value": true, "weight": 50}, - {"value": false, "weight": 50} + {"value": true, "weight": 25}, + {"value": false, "weight": 75} ] } } \ No newline at end of file diff --git a/src/modules/link_card/index.jsx b/src/modules/link_card/index.jsx index ed5f9fa7..9e96568a 100644 --- a/src/modules/link_card/index.jsx +++ b/src/modules/link_card/index.jsx @@ -54,8 +54,10 @@ export default class LinkCard extends Module { } handleClick(evt) { - evt.preventDefault(); + if ( ! this.settings.get('link-cards.enable') ) + return; + evt.preventDefault(); this.openCard(evt.url, evt.source); } diff --git a/src/player.js b/src/player.js index 34ff8486..868288e6 100644 --- a/src/player.js +++ b/src/player.js @@ -14,6 +14,7 @@ import AddonManager from './addons'; import ExperimentManager from './experiments'; import {TranslationManager} from './i18n'; import StagingSelector from './staging'; +import PubSubClient from './pubsub'; import LoadTracker from './load_tracker'; import Site from './sites/player'; @@ -53,6 +54,7 @@ class FrankerFaceZ extends Module { this.inject('i18n', TranslationManager); this.inject('staging', StagingSelector); this.inject('load_tracker', LoadTracker); + this.inject('pubsub', PubSubClient); this.inject('site', Site); this.inject('addons', AddonManager); diff --git a/src/pubsub/index.js b/src/pubsub/index.js index 90e4b8e9..5aa3dcf4 100644 --- a/src/pubsub/index.js +++ b/src/pubsub/index.js @@ -14,7 +14,6 @@ export const State = { CONNECTED: 2 } -const decoder = new TextDecoder(); export default class PubSubClient extends Module { constructor(...args) { @@ -186,36 +185,6 @@ export default class PubSubClient extends Module { this.emit(`socket:command:${data.cmd}`, data.data, data); }); - /*client.on('connect', () => { - this._state = State.CONNECTED; - }); - - client.on('message', (topic, message, packet) => { - let data; - try { - message = decoder.decode(message); - data = JSON.parse(message); - } catch(err) { - this.log.warn(`Error decoding PubSub message on topic "${topic}":`, err); - return; - } - - if ( ! data.cmd ) { - this.log.warn(`Received invalid PubSub message on topic "${topic}":`, data); - return; - } - - data.topic = topic; - - this.log.debug(`Received command on topic "${topic}" for command "${data.cmd}":`, data.data); - this.emit(`socket:command:${data.cmd}`, data.data, data); - - }); - - client.on('close', () => { - this._state = State.CONNECTING; - });*/ - // Subscribe to topics. const topics = [...this._topics.keys()]; client.subscribe(topics);