[openstreetmap/openstreetmap-website] Add UserMute to control private message visibility (PR #4284)
Gregory Igelmund
notifications at github.com
Thu Oct 26 18:44:26 UTC 2023
@grekko commented on this pull request.
> @@ -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?
The redirect is meant to handle the situation in which a user moves the last muted message back into the Inbox, like so:

Once there are no muted Messages anymore, the `Muted`-Tab is hidden and the user is redirected back to the Inbox.
Rendering the template instead would create an inconsistent UI because no Tab would be active. Or we would need to display the `Muted`-Tab even though there are no messages and then hide it once the user clicks on any other link.
Why would you prefer rendering the template?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4284#discussion_r1373642205
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4284/review/1700381203 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231026/e1c38e6a/attachment.htm>
More information about the rails-dev
mailing list