<p></p>
<p><b>@grekko</b> commented on this pull request.</p>
<hr>
<p>In <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1373642205">app/controllers/messages_controller.rb</a>:</p>
<pre style='color:#555'>> @@ -107,6 +107,13 @@ def outbox
@title = t ".title"
end
+ # Display the list of muted messages received by the user.
+ def muted
+ @title = t ".title"
+
+ redirect_to inbox_messages_path if current_user.muted_messages.none?
</pre>
<p dir="auto">The redirect is meant to handle the situation in which a user moves the last muted message back into the Inbox, like so:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/28648/278443680-16ca6c81-bca2-4f98-ac55-8f6033eed7f4.gif"><img src="https://user-images.githubusercontent.com/28648/278443680-16ca6c81-bca2-4f98-ac55-8f6033eed7f4.gif" alt="2023-10-26 20 40 42" data-animated-image="" style="max-width: 100%;"></a></p>
<p dir="auto">Once there are no muted Messages anymore, the <code class="notranslate">Muted</code>-Tab is hidden and the user is redirected back to the Inbox.</p>
<p dir="auto">Rendering the template instead would create an inconsistent UI because no Tab would be active. Or we would need to display the <code class="notranslate">Muted</code>-Tab even though there are no messages and then hide it once the user clicks on any other link.</p>
<p dir="auto">Why would you prefer rendering the template?</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/4284#discussion_r1373642205">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLIIO4VFCRL5MC6SFBLYBKVQVAVCNFSM6AAAAAA53SDOR2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOMBQGM4DCMRQGM">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLN4ZEJOGO6BMZ3ZAP3YBKVQVA5CNFSM6AAAAAA53SDOR2WGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTTFLHBBG.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/4284/review/1700381203</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/4284#discussion_r1373642205",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1373642205",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>