ui/networking: call isTetheringEnabled out of the loop (#29028)

old-commit-hash: 4584e883dc
beeps
Dean Lee 2 years ago committed by GitHub
parent 05181ed6b1
commit ff94bdb79d
  1. 3
      selfdrive/ui/qt/offroad/networking.cc

@ -286,6 +286,7 @@ void WifiUI::refresh() {
scanningLabel->setVisible(is_empty);
if (is_empty) return;
const bool is_tethering_enabled = wifi->isTetheringEnabled();
QList<Network> sortedNetworks = wifi->seenNetworks.values();
std::sort(sortedNetworks.begin(), sortedNetworks.end(), compare_by_strength);
@ -313,7 +314,7 @@ void WifiUI::refresh() {
}
// Forget button
if (wifi->isKnownConnection(network.ssid) && !wifi->isTetheringEnabled()) {
if (wifi->isKnownConnection(network.ssid) && !is_tethering_enabled) {
QPushButton *forgetBtn = new QPushButton(tr("FORGET"));
forgetBtn->setObjectName("forgetBtn");
QObject::connect(forgetBtn, &QPushButton::clicked, [=]() {

Loading…
Cancel
Save