fix auto-select case sensitivity and fix display token data response#282
fix auto-select case sensitivity and fix display token data response#282
Conversation
WalkthroughThe pull request updates the token comparison and search logic. In two component files, the strict equality checks for contract addresses have been replaced by case-insensitive comparisons using Changes
Sequence Diagram(s)sequenceDiagram
participant C as Component
participant E as useEffect Hook
participant R as Token Result
C->>E: Detect update in searchTokenResult
E->>R: Retrieve contract (converted to lowercase)
alt Contract equals searchToken (lowercase)
E-->>C: Auto-select token if only one result exists
else
E-->>C: No auto-selection
end
sequenceDiagram
participant U as User
participant TS as convertAPIResponseToTokens
participant F as Fuse
U->>TS: Provide searchInput
alt searchInput length > 40
TS->>F: Search using [nativeTokens + tokenData] with exact match (=)
else searchInput length ≤ 40
TS->>F: Search nativeTokens with fuzzy threshold 0.3
end
F-->>TS: Return search results
TS-->>U: Output filtered token list
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (3)
🧰 Additional context used🧠 Learnings (1)src/apps/the-exchange/components/DropdownTokensList/DropdownTokenList.tsx (1)⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Deploying x with
|
| Latest commit: |
066675e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1393c183.x-e62.pages.dev |
| Branch Preview URL: | https://feat-mobula-search-api.x-e62.pages.dev |
Description
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Summary by CodeRabbit