1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 19:57:45 +00:00

Fix gate status logic

This commit is contained in:
redstrate 2021-12-03 16:34:32 -05:00
parent 147eaad852
commit 02bc4efa0a

View file

@ -171,12 +171,8 @@ void SquareLauncher::gateOpen() {
connect(reply, &QNetworkReply::finished, [this, reply] {
QJsonDocument document = QJsonDocument::fromJson(reply->readAll());
if(document.isEmpty() || document.object()["status"].toInt() == 0) {
gateStatusRecieved(false);
isGateOpen = false;
} else {
gateStatusRecieved(true);
isGateOpen = true;
}
isGateOpen = !document.isEmpty() && document.object()["status"].toInt() != 0;
gateStatusRecieved(isGateOpen);
});
}