Skip to content

Commit

Permalink
Stop trying to connect if module is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bit0r1n committed Aug 27, 2020
1 parent c6ce9db commit 792de31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions GDAModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ void connectToChat() {

CALLBACK_F(void, update_ws) {
Util::timer_start(pingServer, 20000);
_connection = true;
connectToChat();
Util::timer_start(connectToChat, 5000);
}

CALLBACK_F(void, OnDisable, GDA_MODULE* pModule, bool status) {
_connection = !status;
}

CALLBACK_F(void, OnModuleDraw, GDA_MODULE* pModule) {
if (_connection == false) _connection = true;
if (moduleSettings._show) {
if (!moduleSettings._settingsLoaded) {
moduleSettings._settingsLoaded = true;
Expand Down Expand Up @@ -116,6 +119,7 @@ GDA_MODULE_CALLBACK(GDA_MODULE* pModule) {
ImGui::SetNextWindowFocus();
});
pModule->registerDrawCallback(OnModuleDraw);
pModule->setModuleDisableCallback(OnDisable);
pModule->setClickName(" open ");
return true;
}

0 comments on commit 792de31

Please sign in to comment.