Skip to content

Commit 95da470

Browse files
committed
same check
1 parent 00d469d commit 95da470

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

selfdrive/ui/qt/offroad/settings.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void DevicePanel::reboot() {
199199
if (!uiState()->engaged()) {
200200
if (ConfirmationDialog::confirm("Are you sure you want to reboot?", this)) {
201201
// Check engaged again in case it changed while the dialog was open
202-
if (uiState()->status == UIStatus::STATUS_DISENGAGED) {
202+
if (!uiState()->engaged()) {
203203
Params().putBool("DoReboot", true);
204204
}
205205
}
@@ -212,7 +212,7 @@ void DevicePanel::poweroff() {
212212
if (!uiState()->engaged()) {
213213
if (ConfirmationDialog::confirm("Are you sure you want to power off?", this)) {
214214
// Check engaged again in case it changed while the dialog was open
215-
if (uiState()->status == UIStatus::STATUS_DISENGAGED) {
215+
if (!uiState()->engaged()) {
216216
Params().putBool("DoShutdown", true);
217217
}
218218
}

0 commit comments

Comments
 (0)