fix: preserve wallet context when clicking token on map (#1795)#1818
Open
DukeDeSouth wants to merge 3 commits intoGreenstand:mainfrom
Open
fix: preserve wallet context when clicking token on map (#1795)#1818DukeDeSouth wants to merge 3 commits intoGreenstand:mainfrom
DukeDeSouth wants to merge 3 commits intoGreenstand:mainfrom
Conversation
…nd#1713) marked.parse() was called without the `breaks` option, so single newline characters in wallet/planter/organization about text were rendered as spaces instead of line breaks. Adding `{ breaks: true }` makes marked treat single newlines as <br> tags (GFM-style), which correctly renders line breaks in the about and mission sections across all three entity pages. Co-authored-by: Cursor <[email protected]>
Greenstand#1329) When clicking trees on the map and then navigating to "Home", the highlighted tree icon wrongly stayed on the map. Two root causes: 1. /top page only called setFilters({}) but never clearSelection(), so navigating back to /top left stale selected markers visible. 2. Detail pages (trees, tokens, captures) ran async operations (setFilters, focusTree) before selectTree() without a cancellation guard — if the user navigated away mid-flight, the pending selectTree() would fire after clearSelection(), re-adding the marker. Changes: - Add clearSelection() to top.js reload effect - Add cancelled flag + cleanup return to useEffect in [treeid].js, [tokenid].js, and [captureid].js to prevent race conditions Closes Greenstand#1329 Co-authored-by: Cursor <[email protected]>
) When viewing a wallet page and clicking a token on the map, the wallet filter was lost, causing all tokens to display instead of only the wallet's tokens. Root cause: `getContext()` in pathResolver.js returned `{name: undefined}` for rewritten URLs (e.g. /tokens/idfromquery), causing the token page's useEffect to call `map.setFilters({})` which cleared all wallet filters. Fix: - pathResolver.js: Add null safety checks for regex matches, fix regex to allow URLs without query strings, remove unreachable dead code - [tokenid].js: Use `router.query.walletId` (forwarded by Next.js rewrite) as fallback for wallet context detection Co-authored-by: Cursor <[email protected]>
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.
Summary
Fixes #1795 — When viewing a wallet page and clicking a token on the map, the wallet filter was lost, causing all tokens to display instead of only the wallet's tokens.
Root cause:
getContext()inpathResolver.jsreturned{name: undefined}for Next.js rewritten URLs (e.g./tokens/idfromquery), causing the token page'suseEffectto callmap.setFilters({})which cleared all wallet filters.Fix:
pathResolver.js: Add null safety checks for regex match groups, fix regex to handle URLs without query strings, remove unreachable dead code[tokenid].js: Userouter.query.walletId(forwarded by Next.js rewrite from source pattern) as fallback for wallet context detectionChanges
src/models/pathResolver.jsgetContext()— null safety, regex fix, dead code removalsrc/pages/tokens/[tokenid].jsrouter.query.walletIdTest plan
/tokens/uuid) still work correctlyMade with M7 Cursor