chore(proxy): remove three write-only useState declarations#241
Merged
Conversation
ProxyControl had three state variables whose values were never read, only their setters. Calling them produced empty re-renders. - setLocalLoading: paralleled setSetupLoading and setSpendLoading; the read-side `setupLoading` and `spendLoading` are the live signals - setSelectedUtxos / setManualSelected: stored values from the UTxO selector callback that nothing downstream consumed; the contract already uses all UTxOs from the multisig wallet (per existing comment), so the selection is purely visual The UTxOSelector callback is preserved as a no-op (the prop is required) with a comment explaining the visual-only intent. Net -11 lines, zero behavior change.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProxyControlhad three state variables whose values were destructured away — only the setters were called. Each setter call triggered an empty re-render with nothing downstream reading the value.setLocalLoadingsetSetupLoading/setSpendLoadingsetupLoading/spendLoading(already used in JSX)setSelectedUtxos<UTxOSelector onSelectionChange>callbacksetManualSelectedThe
UTxOSelector.onSelectionChangeprop is required ((selectedUtxos, manualSelected) => voidnot optional), so the callback is preserved as a no-op with an inline comment explaining the visual-only intent. Changing the prop to optional would be a wider refactor across multiple callers (new-transaction/index.tsx,staking/StakingActions/stakingActionCard.tsx,governance/index.tsx) and is out of scope here.Net diff: 4 insertions, 15 deletions. Zero behavior change.
Test plan
🤖 Generated with Claude Code