Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix profile option being marked active when viewing other profiles #565

Merged
merged 5 commits into from
Mar 9, 2024

Conversation

e-five256
Copy link
Member

Right now the Profile header option gets marked active on any user overview page, not just your own. This fixes it so it will only be marked as active when you're viewing your own profile overview.

Before (note looking at user2 as user1)

image


After user2

image

After user1

image

@e-five256 e-five256 added the bug Something isn't working label Mar 8, 2024
@@ -150,7 +150,7 @@
<ul class="dropdown__menu">
<li>
<a href="{{ path('user_overview', {username: app.user.username}) }}"
class="{{ html_classes({'active': is_route_name_contains('user_overview')}) }}">
class="{{ html_classes({'active': is_route_name_contains('user_overview') and user is same as app.user}) }}">
Copy link
Member Author

@e-five256 e-five256 Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I swear I browsed and posted things and everything... if this ever 500s and says "user is undefined"... maybe I should add and user is defined just in case... but it didn't seem needed even after using my site a bunch... maybe I should double check in app_env prod just to make sure, wouldn't want this to cause any issues

Edit: swapped to prod and went around everywhere, seemed fine to me, you'd have to get to the user overview page while logged in and not be viewing a user somehow. checked non-existing users, banned, suspended, all seemed to work fine

@e-five256 e-five256 merged commit f937a08 into main Mar 9, 2024
7 checks passed
@e-five256 e-five256 deleted the e5/fix-profile-active branch March 9, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants