      refresh();
    }
  
    QJsonDocument doc = QJsonDocument::fromJson(cur_destinations.trimmed().toUtf8());
    if (doc.isNull()) {
      qDebug() << "JSON Parse failed on navigation locations";
      return;
 
</s> remove   QJsonDocument doc = QJsonDocument::fromJson(response.trimmed().toUtf8());
 </s> add   QJsonDocument doc = QJsonDocument::fromJson(cur_destinations.trimmed().toUtf8()); </s> remove   if (!success) {
    return;
 </s> add   cur_destinations = response;
  if (isVisible()) {
    refresh(); </s> remove   stack->setCurrentIndex((uiState()->prime_type || success) ? 0 : 1);
 </s> add   if (!success) return;
}

void MapPanel::refresh() {
  stack->setCurrentIndex(uiState()->prime_type ? 0 : 1);
  if (cur_destinations == prev_destinations) return;
      refresh();
    }
}

void MapPanel::refresh() {
  stack->setCurrentIndex(uiState()->prime_type ? 0 : 1);
  if (cur_destinations == prev_destinations) return;
  
    QJsonDocument doc = QJsonDocument::fromJson(cur_destinations.trimmed().toUtf8());
    if (doc.isNull()) {
      qDebug() << "JSON Parse failed on navigation locations";
      return;
keep add keep keep keep keep keep
 MapPanel: refresh only when visible and destination changes (#25739)

rebuild widgets only when mappanel is visible 
selfdrive/ui/qt/maps/map_settings.cc