<p dir="auto"><span class="issue-keyword tooltipped tooltipped-se" aria-label="This pull request closes issue #5959.">Fixes</span> <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3023357139" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5959" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5959/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5959">#5959</a>.</p>
<p dir="auto">To reproduce the bug:</p>
<ol dir="auto">
<li>add <code class="notranslate">sleep 5</code> or something similar into directions search action <a href="https://github.com/openstreetmap/openstreetmap-website/blob/d54310c0dbf0c69ddbaeabfc93e415129dad6f66/app/controllers/directions_controller.rb#L7-L9">https://github.com/openstreetmap/openstreetmap-website/blob/d54310c0dbf0c69ddbaeabfc93e415129dad6f66/app/controllers/directions_controller.rb#L7-L9</a></li>
<li>do steps from <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="3023357139" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5959" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/5959/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/5959">#5959</a></li>
</ol>
<p dir="auto">The fix here delays the route request to be performed after the sidebar finishes loading.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5961'>https://github.com/openstreetmap/openstreetmap-website/pull/5961</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5961/commits/1e8394f04ce2a27f98982ab233defc2881c53cdc" class="commit-link">1e8394f</a>  Schedule route request to be executed later if sidebar is not loaded</li>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5961/commits/d357ec0ff86d13dc56cc2522b246e56bd5d0d6ec" class="commit-link">d357ec0</a>  Enable endpoint listeners before sidebar finishes loading</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5961/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5961/files#diff-fdb9558c2ba79ddf9fbcb92594a8a8fa54abb1b3e25ce264de37951b428a958b">app/assets/javascripts/index/directions.js</a>
    (32)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5961.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5961.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5961.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5961.diff</a></li>
</ul>

<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/5961">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLM2H3M7MHOSGKQEUET23WBPPAVCNFSM6AAAAAB37IBOJKVHI2DSMVQWIX3LMV43ASLTON2WKOZTGAZDGNBYGY4DMOI">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMQ2WWPDPQ7BGROMED23WBPPA5CNFSM6AAAAAB37IBOJKWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHLINV7SU.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/5961</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/5961",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5961",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>