Skip to content

Conversation

@tarrencev
Copy link
Contributor

Summary

  • Enable users to view collectibles and inventory without a connected controller
  • Use owner address from URL path for data fetching in view-only mode
  • Hide action buttons when controller is not connected

Changes

  • New useViewerAddress hook: Resolves viewer address from connected controller or URL path
  • Updated data hooks: Collection/collectible hooks now accept optional accountAddress parameter
  • View-only UI updates: Hide Send/List/Purchase buttons and disable selection when no controller
  • Backward compatibility: All existing functionality preserved for connected users

Test Plan

  • Navigate to /account/[username]/inventory without connected controller
  • Verify inventory items are displayed correctly
  • Confirm all action buttons are hidden in view-only mode
  • Connect controller and verify all actions become available
  • Test viewing another user's inventory while connected
  • Verify selection functionality is disabled in view-only mode

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

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]>
@vercel
Copy link

vercel bot commented Sep 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
controller-example-next Ready Ready Preview Sep 17, 2025 8:52pm
controller-example-next-compat Ready Ready Preview Sep 17, 2025 8:52pm
keychain Ready Ready Preview Sep 17, 2025 8:52pm
keychain-storybook Ready Ready Preview Sep 17, 2025 8:52pm

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]>
cursor[bot]

This comment was marked as outdated.

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);
Copy link

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.

Additional Locations (2)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants