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

fix: Wrong v2 token order on pair detail page causes incorrect balance displayed #7306

Conversation

memoyil
Copy link
Collaborator

@memoyil memoyil commented Jul 6, 2023

To reproduce

Go to https://pancakeswap.finance/find
Try v2 pair that account have with opposite pair order
Click manage pair button
See token balances flipped and incorrect amount shown

🤖 Generated by Copilot at a4aaf68

Summary

🗑️♻️🛠️

This pull request refactors the liquidity and pair pages to use a common pair object that contains the relevant data for each pair. It also improves the code style, fixes a broken link, and removes an unused code block.

Oh we're the coders of the sea, and we work with pair objects
We refactor and we style, and we fix the broken links
Heave away, me hearties, heave away with care
For we're the coders of the sea, and we use the pair objects

Walkthrough

  • Refactor the liquidity page to use the pair object as the source of truth instead of individual currency variables (link, link, link, link, link, link, link, link, link)
  • Remove an empty code block from the apps/web/src/pages/liquidity/index.tsx file (link)
  • Update the import statements in the apps/web/src/views/PoolFinder/index.tsx file to use relative paths and reorder them by type and alphabetically (link)

@changeset-bot
Copy link

changeset-bot bot commented Jul 6, 2023

⚠️ No Changeset found

Latest commit: a4aaf68

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jul 6, 2023

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

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 6, 2023 0:05am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Jul 6, 2023 0:05am
blog ⬜️ Ignored (Inspect) Jul 6, 2023 0:05am
bridge ⬜️ Ignored (Inspect) Jul 6, 2023 0:05am
uikit ⬜️ Ignored (Inspect) Jul 6, 2023 0:05am

@vercel
Copy link

vercel bot commented Jul 6, 2023

@memoyil is attempting to deploy a commit to the PancakeSwap Team on Vercel.

A member of the Team first needs to authorize it.

@chefjackson chefjackson merged commit d8fe08f into pancakeswap:develop Jul 7, 2023
11 checks passed
@memoyil memoyil deleted the feature/fix_wrong_v2_order_pairs_results_wrong_balance branch July 7, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants