  
    // TODO: do we really need to update this frequently?
    QString dongleId = QString::fromStdString(Params().get("DongleId"));
    QString url = "https://api.commadotai.com/v1.1/devices/" + dongleId + "/stats";
    RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_DriveStats", 13);
    QObject::connect(repeater, &RequestRepeater::receivedResponse, this, &DriveStats::parseResponse);
  }
 
</s> remove   QVBoxLayout* vlayout = new QVBoxLayout(this);
  vlayout->addLayout(gl);

  // TODO: do we really need to update this frequently?
 </s> add  </s> remove   // setup labels for each alert
  QString json = QString::fromStdString(util::read_file("../controls/lib/alerts_offroad.json"));
  QJsonObject obj = QJsonDocument::fromJson(json.toUtf8()).object();
  for (auto &k : obj.keys()) {
    QLabel *l = new QLabel(this);
    alerts[k.toStdString()] = l;
    int severity = obj[k].toObject()["severity"].toInt();

    l->setMargin(60);
    l->setWordWrap(true);
    l->setStyleSheet("background-color: " + QString(severity ? "#E22C2C" : "#292929"));
    l->setVisible(false);
    alerts_layout->addWidget(l);
  }

  alerts_layout->addStretch(1);

 </s> add  </s> remove   refresh(); // don't wait for the first refresh
 </s> add }

void PairingQRWidget::showEvent(QShowEvent *event){
  refresh(); </s> remove   QString IMEI = QString::fromStdString(Params().get("IMEI"));
  QString serial = QString::fromStdString(Params().get("HardwareSerial"));
 </s> add   Params params;
  QString IMEI = QString::fromStdString(params.get("IMEI"));
  QString serial = QString::fromStdString(params.get("HardwareSerial"));
  RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_DriveStats", 30);
  
    // TODO: do we really need to update this frequently?
    QString dongleId = QString::fromStdString(Params().get("DongleId"));
    QString url = "https://api.commadotai.com/v1.1/devices/" + dongleId + "/stats";
  RequestRepeater *repeater = new RequestRepeater(this, url, "ApiCache_DriveStats", 30);
    QObject::connect(repeater, &RequestRepeater::receivedResponse, this, &DriveStats::parseResponse);
  }
keep keep keep keep replace keep keep
 UI: fast startup (#20781)

* faster startup

* faster

* cleanup

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/ui/qt/widgets/drive_stats.cc