Improve reconnect
This commit is contained in:
@@ -52,12 +52,10 @@ public:
|
||||
|
||||
void onEnter(StateMachineBase &stateMachine) override {
|
||||
Serial.println("Entering NetworkInitializeState");
|
||||
if (appContext && appContext->network) {
|
||||
delete appContext->network;
|
||||
appContext->network = nullptr;
|
||||
}
|
||||
if (appContext && !appContext->network) {
|
||||
appContext->network = new Network(hostName, friendlyName);
|
||||
} else if (appContext && appContext->network) {
|
||||
appContext->network->reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user