fix errors when getting text without update-type
This commit is contained in:
parent
04dc93e951
commit
1775b16fde
1 changed files with 9 additions and 7 deletions
16
src/main.cpp
16
src/main.cpp
|
@ -173,13 +173,15 @@ void handleWebSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
|
||||||
is_currently_preview = false;
|
is_currently_preview = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (strcmp(doc["update-type"], "Exiting") == 0) {
|
} else if (doc.containsKey("update-type")) {
|
||||||
Serial.println("[OBS] quit");
|
if (strcmp(doc["update-type"], "Exiting") == 0) {
|
||||||
is_currently_preview = false;
|
Serial.println("[OBS] quit");
|
||||||
is_currently_live = false;
|
is_currently_preview = false;
|
||||||
} else if (strcmp(doc["update-type"], "StudioModeSwitched") == 0 && !doc["new-state"]) {
|
is_currently_live = false;
|
||||||
Serial.println("[OBS] studio mode disabled");
|
} else if (strcmp(doc["update-type"], "StudioModeSwitched") == 0 && !doc["new-state"]) {
|
||||||
is_currently_preview = false;
|
Serial.println("[OBS] studio mode disabled");
|
||||||
|
is_currently_preview = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_currently_live) {
|
if (is_currently_live) {
|
||||||
|
|
Loading…
Reference in a new issue