feat: support viewing inventory without connected controller#2037
Open
feat: support viewing inventory without connected controller#2037
Conversation
Allow users to view collectibles and inventory when they don't have a controller connected by using the owner address from the URL path. Changes: - Add useViewerAddress hook to handle address resolution from URL or connected controller - Update collection/collectible hooks to accept optional accountAddress parameter - Hide action buttons (Send, List, Purchase) when in view-only mode - Disable selection functionality when viewing without controller - Maintain full backward compatibility for existing functionality This enables read-only access to inventory pages for users browsing without authentication while preserving all interactive features for connected users. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Always use the address from the URL path for viewing inventory/collectibles, removing complex fallback logic and the overridable flag. Changes: - Remove overridable parameter from useAccountProfile - Simplify useViewerAddress to always use path address - Update all hooks to use useAccountProfile directly - Replace isViewOnly with canPerformActions for clearer semantics - Remove accountAddress parameters from collection/collectible hooks This makes the code much easier to understand: the URL always determines what inventory is being viewed, and actions are only available when viewing your own connected account. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Update useAccountProfile to handle both username and address parameters in the URL path. This allows navigation to inventory using either format: - /account/username/inventory - /account/0xAddress/inventory When an address is provided (starts with 0x), it's used directly and the username is fetched. When a username is provided, the address is resolved from it. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Update Home.tsx to allow public paths like /account/*/inventory to be viewed without a controller connection. This prevents the redirect to login when users are trying to view inventories. - Add public paths check to bypass login requirement - Handle controller-less state for public paths - Skip upgrade checks when no controller present 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
The connect context can only be reached when controller is defined, but TypeScript couldn't infer this. Added non-null assertions to fix the build error.
| // Get token data from torii | ||
| const { tokens: toriiTokens, status: toriiStatus } = | ||
| useBalances(accountAddress); | ||
| const { tokens: toriiTokens, status: toriiStatus } = useBalances(address); |
There was a problem hiding this comment.
Bug: Profile Credits Display Error
The recent changes to use the viewed profile's address (useViewerAddress(), useAccountProfile()) have incorrectly applied it to personal data. Credits are now fetched for the viewed profile in useTokens(), showing incorrect balances in the inventory list. This also creates an inconsistency with the Credits component, which still displays the connected user's credits. Additionally, ERC20 token transfer history may show connected user data instead of the viewed profile's.
Additional Locations (2)
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
Changes
useViewerAddresshook: Resolves viewer address from connected controller or URL pathaccountAddressparameterTest Plan
/account/[username]/inventorywithout connected controllerThis enables read-only access to inventory pages for users browsing without authentication while preserving all interactive features for connected users.
🤖 Generated with Claude Code