Skip to content

fix: suppress premature approval error while wallet is pending (#32)#232

Open
mkcash wants to merge 1 commit into
capofficial:mainfrom
mkcash:fix/wrong-approval-error-msg-32
Open

fix: suppress premature approval error while wallet is pending (#32)#232
mkcash wants to merge 1 commit into
capofficial:mainfrom
mkcash:fix/wrong-approval-error-msg-32

Conversation

@mkcash
Copy link
Copy Markdown

@mkcash mkcash commented May 27, 2026

Fixes #32

Problem

When user clicks "Approve CAP" in Stake modal, the error handler fired before wallet confirmation completes, showing a confusing error message.

Changes

  1. approveAsset(): Don't call showError() for approval errors — log only
  2. StakeCAP.svelte: Add isLoading state to approve button to show pending state and prevent double-clicks
  3. Handle user-denied/rejected approvals gracefully

Bug: When user clicks 'Approve CAP' in Stake modal, the error handler
fires before wallet (Metamask) confirmation completes, showing confusing error.

Changes:
- Don't call showError() for approval errors
- Handle user-denied/rejected gracefully
- Add isLoading state to approve button to prevent double-clicks

Fixes capofficial#32
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.

Wrong error message while approving CAP on Stake function

1 participant