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

<hr>

<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4875#discussion_r1625998576">app/views/users/show.html.erb</a>:</p>
<pre style='color:#555'>> @@ -15,6 +15,7 @@
             </li>
             <li>
               <%= link_to t(".my notes"), user_notes_path(@user) %>
+              <span class='badge count-number'><%= number_with_delimiter(current_user.notes.size) %></span>
</pre>
<p dir="auto">They are not generally the same. <code class="notranslate">current_user</code> is the currently logged in user, and <code class="notranslate">@user</code> is the user whose profile page you are showing.</p>
<p dir="auto">Now in this specific situation, they are the same user, since they come after an equality check (<code class="notranslate">if current_user and @user.id == current_user.id</code>), so they can be used interchangeable - but elsewhere in this file they cannot.</p>
<p dir="auto">I think the problem here is that although this block is mostly using <code class="notranslate">current_user</code> (e.g. for the edits count, 6 lines above), the line immediately above is using <code class="notranslate">@user</code>, and so seeing it switch between two lines suggests an error. My initial reaction is that we should use <code class="notranslate">current_user</code> throughout the <code class="notranslate"><!-- Displaying user's own profile page --></code> section, for clarity.</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/4875#discussion_r1625998576">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLONAG47HS3KKI4QDZLZFW5MPAVCNFSM6AAAAABIYGPCSWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAOJWGM4DINRXGY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOGSGPCFJXFX6NQD3LZFW5MPA5CNFSM6AAAAABIYGPCSWWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTT46RFKI.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/4875/review/2096384676</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/4875#discussion_r1625998576",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4875#discussion_r1625998576",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>