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: update back button to redirect to home when no route history #241

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

satnaing
Copy link
Owner

Description

Update back button in PostDetails.astro to redirect to home page when there's no route history.
If a blog post url is pasted in the browser and there's no route history, prior to this commit, back button did not work as expected. Now, if there's somewhere to go back, the back button will go back to the previous route.
If not, the back button will redirect to home page.

Before

before-back-btn-fix.mp4

After

after-back-btn-fix.mp4

Tested Browsers

  • Chrome ✅ (mobile/desktop)
  • Safari ✅ (mobile/desktop)
  • Opera ✅ (mobile/desktop)
  • Firefox ✅
  • Edge ✅

Update back button in PostDetails.astro to redirect to home page when
there's no route history.
If a blog post url is pasted in the browser and there's no route history,
prior to this commit, back button did not work as expected.
Now, if there's somewhere to go back, the back button will go back to the
previous route.
If not, the back button will redirect to home page.
@satnaing satnaing merged commit 8f75f0a into main Jan 22, 2024
2 checks passed
@satnaing satnaing deleted the fix/back-btn-update branch January 22, 2024 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant