1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-09 15:50: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

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