8000 fix: multisig data disappears while signing multiple multisig tx's from same account by rajk93 · Pull Request #11552 · polkadot-js/apps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: multisig data disappears while signing multiple multisig tx's from same account #11552

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 2 commits into from
May 15, 2025

Conversation

rajk93
Copy link
Contributor
@rajk93 rajk93 commented May 14, 2025

fixes #11546

Problem

The MultisigApprove modal was experiencing a UI glitch where the "call data for final approval" input field was constantly being reset during user interaction. This occurred because:

  1. Any blockchain event (even those unrelated to multisig) would trigger the useMultisigApprovals hook
  2. This caused unnecessary re-renders of the MultisigApprove component
  3. Each re-render would reset the input field value (callHex), making it impossible for users to input or edit call data

Solution

The fix optimizes the useMultisigApprovals hook to prevent unnecessary triggers and re-renders:

  1. Added a useRef to track previously processed multisig events
  2. Implemented a filtering mechanism that only processes events that are:
    • From the multisig section
    • Related to the current address
    • Different from previously processed events
  3. Created a comparison system using JSON.stringify to generate a hash of relevant events and only trigger updates when this hash changes

Previous behaviour

Screen.Recording.2025-05-13.at.2.33.33.PM.mov

Current behaviour (after fix)

updated.mov

@ap211unitech
Copy link
Member

Needs yarn lint

@rajk93
Copy link
Contributor Author
rajk93 commented May 14, 2025

Needs yarn lint

resolved in ef241a3

@ap211unitech ap211unitech self-requested a review May 14, 2025 09:35
Copy link
Member
@ap211unitech ap211unitech left a comment

Choose a reason for hiding this comment

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

Great job 👌

@ap211unitech ap211unitech merged commit 7ef2b3e into polkadot-js:master May 15, 2025
5 checks passed
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.

Multisig data disappears when signing multiple multisig tx's on same account
2 participants
0