Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces environment-aware default market selection, setting the default to 'VOLX-USDH' for testnet and 'CL-USDC' for other environments. The index route was updated to utilize these dynamic defaults. Feedback suggests that the useEffect hook in the index route may be redundant and potentially disruptive to the user experience, as it overrides persisted market selections every time the home page is visited.
|
|
||
| useEffect(() => { | ||
| setSelectedMarket("all", "VOLX-USDH"); | ||
| setSelectedMarket("all", DEFAULT_SELECTED_MARKETS.all); |
There was a problem hiding this comment.
This useEffect hook overrides the persisted market selection with the default value every time the user navigates to the home page. Since the marketStore already initializes with DEFAULT_SELECTED_MARKETS and handles persistence (as seen in use-market-store.ts), this call is likely redundant and potentially disruptive to the user experience as it clears their last selected market. Consider removing this useEffect block and the associated setSelectedMarket call to respect the persisted state.
No description provided.