mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-09 15:50:53 +00:00
4.55.1
* 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:
parent
98e5373e9a
commit
29419eee22
6 changed files with 10 additions and 35 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue