<p></p>
<p><b>@HolgerJeromin</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1940756914">app/assets/javascripts/edit/id.js.erb</a>:</p>
<pre style='color:#555'>> -
-    if (mapParams.object) {
-      params.set("id", mapParams.object.type + "/" + mapParams.object.id);
-      mapParams = OSM.parseHash(location.hash);
-      if (mapParams.center) {
-        params.set("map", mapParams.zoom + "/" + mapParams.center.lat + "/" + mapParams.center.lng);
-      }
-    } else if (id.data("lat") && id.data("lon")) {
-      params.set("map", "16/" + id.data("lat") + "/" + id.data("lon"));
-    } else {
-      params.set("map", (mapParams.zoom || 17) + "/" + mapParams.lat + "/" + mapParams.lon);
-    }
+  if (id.data("configured") === false) {
+    alert(I18n.t("site.edit.id_not_configured"));
+    return;
+  }
</pre>
<p dir="auto">Early return results often in less indention which is IMO good.</p>
<p dir="auto">And while reading the code you do not need to find the <code class="notranslate">else</code> branch.<br>
Having the branch with fewer code lines on top can help without the downsides of multiple returns.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1940756914">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPBCMH66NCTUF2PYOT2OB6IZAVCNFSM6AAAAABWMGSMVOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOJSGE2DKNRYHE">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOGZ2YI6VVUJMM2RSD2OB6IZA5CNFSM6AAAAABWMGSMVOWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTU2QEARS.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5597/review/2592145689</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1940756914",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5597#discussion_r1940756914",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>