[openstreetmap/openstreetmap-website] Remove global "awaiting geocode" routing state (PR #4896)

Anton Khorev notifications at github.com
Fri Jun 14 16:25:35 UTC 2024


`/directions` javascript has an `awaitingGeocode` state variable, which is true when one of endpoints awaits geocoding results. But each endpoint has its own `awaitingGeocode` state variable too. Endpoint methods manipulate both global and their own state. Why do they need the global state? Only to decide if they need to run `getRoute()`. But `getRoute()` checks `awaitingGeocode` on endpoints anyway. There's no need for the global state.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4896

-- Commit Summary --

  * Remove global "awaiting geocode" routing state

-- File Changes --

    M app/assets/javascripts/index/directions.js (10)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4896.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4896.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/4896 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240614/92c9c30b/attachment-0001.htm>


More information about the rails-dev mailing list