Skip to content

Commit

Permalink
fix: Chat already connected (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
skarab42 committed Feb 13, 2021
1 parent 9944d49 commit e3af5da
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/server/libs/twitch/chat/connect.js
Expand Up @@ -22,14 +22,10 @@ chat.onDisconnect((manually) => {
});

function connect() {
if (state.get("chat.connected")) {
if (state.get("chat.connected") || state.get("chat.connecting")) {
return Promise.resolve({ alreadyConnected: true });
}

if (state.get("chat.connecting")) {
throw new Error("Twitch chat already connecting...");
}

state.set("chat.connecting", true);

return chat
Expand Down

0 comments on commit e3af5da

Please sign in to comment.