From f6d9cfe5063d008e675ea0ba376d46d10996206d Mon Sep 17 00:00:00 2001 From: Jingles Date: Sun, 10 May 2026 16:53:41 +0800 Subject: [PATCH] chore(proxy): remove three write-only useState declarations 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. --- .../multisig/proxy/ProxyControl.tsx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/components/multisig/proxy/ProxyControl.tsx b/src/components/multisig/proxy/ProxyControl.tsx index e575086f..220d831b 100644 --- a/src/components/multisig/proxy/ProxyControl.tsx +++ b/src/components/multisig/proxy/ProxyControl.tsx @@ -122,7 +122,6 @@ export default function ProxyControl() { // State management const [proxyContract, setProxyContract] = useState(null); const [isProxySetup, setIsProxySetup] = useState(false); - const [, setLocalLoading] = useState(false); const [tvlLoading, setTvlLoading] = useState(false); // Setup flow state @@ -149,10 +148,6 @@ export default function ProxyControl() { { address: "", unit: "lovelace", amount: "" } ]); - // UTxO selection state (UI only). We will still pass all UTxOs from provider to contract. - const [, setSelectedUtxos] = useState([]); - const [, setManualSelected] = useState(false); - // Helper to resolve inputs for multisig controlled txs const getMsInputs = useCallback(async (): Promise<{ utxos: UTxO[]; walletAddress: string }> => { if (!appWallet?.address) { @@ -264,8 +259,7 @@ export default function ProxyControl() { try { setSetupLoading(true); - setLocalLoading(true); - + // Reset setup data to prevent conflicts with previous attempts setSetupData({}); setSetupStep(0); @@ -301,7 +295,6 @@ export default function ProxyControl() { }); } finally { setSetupLoading(false); - setLocalLoading(false); } }, [proxyContract, isWalletReady, getMsInputs, newTransaction, toast]); @@ -318,7 +311,6 @@ export default function ProxyControl() { try { setSetupLoading(true); - setLocalLoading(true); // If msCbor is set, route through useTransaction hook to create a signable if (appWallet?.scriptCbor && setupData.txHex) { @@ -395,7 +387,6 @@ export default function ProxyControl() { }); } finally { setSetupLoading(false); - setLocalLoading(false); } }, [setupData, activeWallet, appWallet, createProxy, refetchProxies, getMsInputs, newTransaction, userAddress, toast]); @@ -600,7 +591,6 @@ export default function ProxyControl() { try { setSpendLoading(true); - setLocalLoading(true); // Get the selected proxy const proxy = proxies?.find((p: { id: string }) => p.id === selectedProxyId); @@ -672,7 +662,6 @@ export default function ProxyControl() { }); } finally { setSpendLoading(false); - setLocalLoading(false); } }, [proxyContract, isWalletReady, spendOutputs, selectedProxyId, proxies, network, activeWallet, handleProxySelection, getMsInputs, newTransaction, appWallet?.scriptCbor, toast]); @@ -840,9 +829,9 @@ export default function ProxyControl() { { - setSelectedUtxos(utxos); - setManualSelected(manual); + onSelectionChange={() => { + // Selection is for user visibility only; + // contract uses all UTxOs from the multisig wallet. }} />