Skip to content

fix: swap screen freezes when swap allowance fails #4102

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

Merged
merged 3 commits into from
Mar 28, 2025
Merged

Conversation

magiziz
Copy link
Contributor

@magiziz magiziz commented Mar 28, 2025

Description

Fixed an issue where the swap screen froze if allowance approval failed

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-2225

Showcase (Optional)

Before:

before.mov

After:

after.mov

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

Copy link

linear bot commented Mar 28, 2025

Copy link

vercel bot commented Mar 28, 2025

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

Name Status Preview Comments Updated (UTC)
appkit-demo 🛑 Canceled (Inspect) Mar 28, 2025 11:22am
appkit-laboratory 🛑 Canceled (Inspect) 💬 Add feedback Mar 28, 2025 11:22am
12 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-ep ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-basic-ep-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-basic-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-basic-up-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-ethers5-bera ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-nansen-demo ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-vue-solana ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Visit Preview Mar 28, 2025 11:22am
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am
vue-wagmi-example ⬜️ Ignored (Inspect) Mar 28, 2025 11:22am

Copy link

changeset-bot bot commented Mar 28, 2025

🦋 Changeset detected

Latest commit: 4d0c1e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@reown/appkit-controllers Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-common Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-polyfills Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

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

SwapController.swapTokens()

return
await SwapController.swapTokens()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there was a fetch error we did an early return and it never redirected to SwapPreview screen

Copy link
Contributor

Choose a reason for hiding this comment

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

👌🏽

Copy link
Contributor

Warnings
⚠️ File packages/scaffold-ui/src/views/w3m-swap-view/index.ts contains a KEY or SECRET

Generated by 🚫 dangerJS against 4d0c1e7

Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 75.19% 24851 / 33050
🔵 Statements 75.19% 24851 / 33050
🔵 Functions 66.34% 2099 / 3164
🔵 Branches 82.89% 4740 / 5718
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/scaffold-ui/src/views/w3m-swap-view/index.ts 68.57% 82.6% 83.33% 68.57% 71-75, 80-82, 85-87, 90-102, 124, 130-132, 145, 154-155, 158-159, 175, 188, 209, 213-239, 250-257, 279
Generated in workflow #10523 for commit 4d0c1e7 by the Vitest Coverage Report Action

@magiziz magiziz enabled auto-merge (squash) March 28, 2025 11:23
@magiziz magiziz merged commit ae79b16 into main Mar 28, 2025
31 checks passed
@magiziz magiziz deleted the fix/swap-freeze branch March 28, 2025 11:33
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