-
Notifications
You must be signed in to change notification settings - Fork 42
feat: support viewing inventory without connected controller #2037
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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