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:
parent
147eaad852
commit
02bc4efa0a
1 changed files with 3 additions and 7 deletions
|
@ -171,12 +171,8 @@ void SquareLauncher::gateOpen() {
|
||||||
connect(reply, &QNetworkReply::finished, [this, reply] {
|
connect(reply, &QNetworkReply::finished, [this, reply] {
|
||||||
QJsonDocument document = QJsonDocument::fromJson(reply->readAll());
|
QJsonDocument document = QJsonDocument::fromJson(reply->readAll());
|
||||||
|
|
||||||
if(document.isEmpty() || document.object()["status"].toInt() == 0) {
|
isGateOpen = !document.isEmpty() && document.object()["status"].toInt() != 0;
|
||||||
gateStatusRecieved(false);
|
|
||||||
isGateOpen = false;
|
gateStatusRecieved(isGateOpen);
|
||||||
} else {
|
|
||||||
gateStatusRecieved(true);
|
|
||||||
isGateOpen = true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue