Merged
Conversation
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
Signed-off-by: bgravenorst <byron.gravenorst@consensys.net>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the sidebar routing issue in the Wallet API documentation by adjusting how URL paths are transformed in the transformItems function.
- Fix root path handling by converting "/index" endings and "/" to the correct "/wallet/" routes
- Update code style by standardizing quotes and formatting in the file
Comment on lines
+32
to
42
| if (!newItem.href.startsWith("/")) { | ||
| newItem.href = `/${newItem.href}`; | ||
| } | ||
| if (newItem.href.endsWith("/index")) { | ||
| newItem.href = newItem.href.slice(0, -5); | ||
| } | ||
| if (!newItem.href.startsWith("/")) { | ||
| newItem.href = `/${newItem.href}`; | ||
| if (newItem.href === "/") { | ||
| newItem.href = "/wallet/"; | ||
| } else { | ||
| newItem.href = `/wallet${newItem.href}`; | ||
| } |
There was a problem hiding this comment.
Consider consolidating the URL normalization logic in the transformItems function. For clarity, ensure that the decision to always prefix with '/wallet' aligns with handling both absolute and relative paths uniformly.
Suggested change
| if (!newItem.href.startsWith("/")) { | |
| newItem.href = `/${newItem.href}`; | |
| } | |
| if (newItem.href.endsWith("/index")) { | |
| newItem.href = newItem.href.slice(0, -5); | |
| } | |
| if (!newItem.href.startsWith("/")) { | |
| newItem.href = `/${newItem.href}`; | |
| if (newItem.href === "/") { | |
| newItem.href = "/wallet/"; | |
| } else { | |
| newItem.href = `/wallet${newItem.href}`; | |
| } | |
| newItem.href = normalizeHref(newItem.href); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix Wallet API Documentation Introduction Link Routing
Problem
The "Introduction" link in the Wallet API documentation sidebar was incorrectly routing to
/wallet/index/instead of/wallet/, causing a "Page not found" error. This was due to the order of operations in thetransformItemsfunction where path transformations were being applied in an incorrect sequence.Changes
/wallet/instead of/wallet/index/Fixes
Fixes #1854
Preview
Checklist
Complete this checklist before merging your PR: