1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
* Fixed: Link Cards always opening regardless of the setting. Sorry about that, some code got deleted in a refactor and I didn't notice.
This commit is contained in:
SirStendec 2023-09-26 19:39:39 -04:00
parent 98e5373e9a
commit 29419eee22
6 changed files with 10 additions and 35 deletions

View file

@ -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",

View file

@ -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);

View file

@ -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}
]
}
}

View file

@ -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);
}

View file

@ -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);

View file

@ -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);