-
Notifications
You must be signed in to change notification settings - Fork 16
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 double locale bug in back navigation #2408
base: develop
Are you sure you want to change the base?
Conversation
- improves logic to handle paths already containing locales
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis change refines the logic within the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant F as getLocalizedPath
U->>F: Call getLocalizedPath(path, locale)
F->>F: Split path into segments
F->>F: Check if first segment equals locale
alt Locale matches
F->>U: Return original path
else Locale does not match
F->>F: Insert locale into path
F->>U: Return updated path
end
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (1)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I no longer encounter the "Ressource not found" issue, the map is not really zooming out now, and is basically "stuck" on Africa. Tested in normal browser-window as well as incognito.
That's a non related existing bug on the map. It seems like this happens when the project details page is directly opened. I've added this as an issue and will look into it soon. |
Resolve an issue with back navigation that caused double locale entries by improving the logic for handling paths that already contain locales.
To reproduce issue:
Open https://dev.pp.eco/en/yucatan in a new browser tab. After the page loads, press back. You should see the url https://dev.pp.eco/en/en and an error message ("Resource not found").
Try out the same approach with the preview link in this PR (append /yucatan or /en/yucatan after the link), the issue should no longer be seen