Skip to content

Conversation

@impelcrypto
Copy link
Contributor

@impelcrypto impelcrypto commented Sep 29, 2025

Pull Request Summary

  • fix: display Available amount after staking correctly

Check list

  • contains breaking changes
  • adds new feature
  • modifies existing feature (bug fix or improvements)
  • relies on other tasks
  • documentation changes
  • tested on mobile devices

This pull request makes the following changes:

Fixes

The fix now uses remainingLockedTokensInitial instead of the reactive remainingLockedTokens.value. This ensures that:

  1. The initial locked tokens value is captured before any staking amount is entered (this happens in the watch at the bottom of this file)
  2. When calculating availableToVoteDisplay, we use this fixed initial value
  3. This prevents the double-counting issue where the staking amount was reducing both remainingLockedTokens and being subtracted again in the display calculation

Now when you enter a staking amount:

  • The available balance will simply decrease by that amount
  • The remaining locked tokens display will update correctly

=Before=

  • The Available amount after staking should be 558 as the inputted amount is 100, but the result is 458, it decreased the amount twice.
image image

=After=

image

@impelcrypto impelcrypto marked this pull request as ready for review September 29, 2025 09:28
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 20ea62a):

https://astar-apps--pr1504-fix-dapp-staking-val-pv3ov2u2.web.app

(expires Mon, 06 Oct 2025 09:28:46 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: dd76fe72958fe2910fef9d53f0b4539b82b849db

@impelcrypto impelcrypto requested a review from gtg7784 September 29, 2025 13:21
@impelcrypto impelcrypto merged commit c1e5a39 into release-hotfix Oct 1, 2025
5 of 6 checks passed
@impelcrypto impelcrypto deleted the fix/dapp-staking-value branch October 1, 2025 12:51
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.

4 participants