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

feat: display same source and destination token warning on widget #945

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

mikasackermn
Copy link
Collaborator

@mikasackermn mikasackermn commented Nov 12, 2024

Summary

If the source and destination tokens are selected as the same, we should show a warning to the user.

Fixes # (issue)

How did you test this change?

Select the same token for both the source and destination, and also enter an amount

Checklist:

  • I have performed a self-review of my code

@@ -38,6 +38,8 @@ export function NoResult(props: PropTypes) {
fetch
);

console.log(info);
Copy link
Member

Choose a reason for hiding this comment

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

Please remove logs

@@ -107,7 +105,14 @@ export function useSwapInput({
affiliatePercent,
affiliateWallets,
} = params;
if (areTokensEqual(fromToken, toToken)) {
console.log('....');
Copy link
Member

Choose a reason for hiding this comment

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

Please remove logs

@Ikari-Shinji-re
Copy link
Member

In the current implementation, the warning appears after the debounce period for the input. If the user changes the input, the warning will be cleared and then reappear after the debounce delay. I suggest leaving the existing logic for the quote unchanged and simply adding a check and warning for this specific state in the relevant component, so the warning displays immediately without delay.

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