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

🐛 BUG: Browser navigation not working properly on notification page #1216

Open
1 task done
miroirstudiosrl opened this issue Jun 12, 2024 · 4 comments
Open
1 task done

Comments

@miroirstudiosrl
Copy link

miroirstudiosrl commented Jun 12, 2024

What went wrong? 🤔

When you navigate to the notification page after opening at least one post going back in history (using the browser back arrow for example) doesn't work. The url changes but the pages remains the notifiication's one.
I've noticed that this seems to be related with post's modals since if you don't open them before going on notification page this bug doesn't occurs.

Steps to Reproduce Issue

1. Open a post
2. Close the post's modal
3. Open notification page
4. Navigate back

Solution Proposed

I think the problem is that modals are put in navigation history (in order to close them navigating back), but they aren't properly removed from history when manually closed.

Environment

No response

Browsers

No response

OS

No response

Version of daily.dev

No response

Additional Context

No response

Code of Conduct

  • I follow the conditions of this project.
@ParthTyagi15
Copy link

Hey @miroirstudiosrl I wanted to work on this issue, but I am not able to reproduce this issue on my end here. Can you provide screenshots of the issue, if possible?

@idoshamun
Copy link
Member

Hi @miroirstudiosrl,

Thanks a lot for reporting it. We will look into that

@sshanzel
Copy link
Member

Hey @miroirstudiosrl I wanted to work on this issue, but I am not able to reproduce this issue on my end here. Can you provide screenshots of the issue, if possible?

@ParthTyagi15 was able to reproduce it. First go to any feed -> click any post -> modal will opened -> close the modal -> click the notifications page -> click browser back button. If you skip clicking any post, it should not reproduce. So the issue is definitely the way we handle the URL change on opening the modal. There should be a hook called usePostModalNavigation that facilitates the processing.

@ParthTyagi15
Copy link

@sshanzel Thank you for the reply. Yes, now I am able to see the issue. It only happens if I close the post modal by clicking somewhere outside the Modal. If I close the post using the back arrow in the browser and then go to the notifications page(or any other page for that matter) and then again go back, the issue is not there. So I also agree it's the way we handle the URL change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants