[openstreetmap/openstreetmap-website] Fix home location error after page refresh (PR #7351)

Mohd Farhan Akhtar notifications at github.com
Mon Aug 31 17:40:21 UTC 2026


@imfarhan0105-bits commented on this pull request.



> @@ -29,6 +29,30 @@ export default function (map) {
     }
   };
 
+  page.init = function () {
+    map.setSidebarOverlaid(true);
+    clearMarker();
+
+    if (OSM.home) {
+      const hashState = OSM.parseHash(location.hash);
+      if (!hashState.center) {
+        OSM.router.withoutMoveListener(function () {

Yeah, you're right. I separated `page.load` and `page.init` because they need to handle the hash a little differently, but I didn’t realise that would also duplicate the common setup. I’ll clean that up and keep the shared part in one place. I’ll update the PR shortly.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7351#discussion_r3896878712
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/7351/review/5069424743 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260831/9e9dcebb/attachment.htm>


More information about the rails-dev mailing list