Skip to content
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

chore: trim the query when searching for wallets #2167

Merged
merged 8 commits into from
Apr 25, 2024

Conversation

lukaisailovic
Copy link
Collaborator

When searching for wallets we would send any whitespace as well which would present us with "no wallets" screen.

Made two changes:

  • Sending trimmedQuery to ApiController instead of query
  • Compare trimmedQuery with previous query that is also trimmed. This will not send network calls for whitespaces

Copy link

vercel bot commented Apr 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3modal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 25, 2024 6:09pm
web3modal-gallery ✅ Ready (Inspect) Visit Preview Apr 25, 2024 6:09pm
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Apr 25, 2024 6:09pm

Copy link
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this should be inside of ApiController directly + test?

@lukaisailovic
Copy link
Collaborator Author

Wondering if this should be inside of ApiController directly + test?

@tomiir Thats a good point. I think I will have to trim on the UI layer to not trigger additional requests (changed if condition).

Do you think we should add trimming to the controller in addition to the current logic?

@chris13524
Copy link
Member

+1 on a test for this

Copy link
Contributor

github-actions bot commented Apr 22, 2024

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 81.49% 2520 / 14979
🔵 Statements 81.49% 2520 / 14979
🔵 Functions 89.71% 122 / 509
🔵 Branches 119.62% 182 / 484
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/core/src/controllers/ApiController.ts 93.49% 75% 77.77% 93.49% 53-54, 117-118, 130, 220-224, 240-245
Generated in workflow #3323

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.

3 participants