Skip to content

Commit

Permalink
fix(wallet): Remove dep from usEffect in Amount component
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyphillips committed Jan 26, 2024
1 parent 75fa00b commit 5b64da8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/screens/Wallets/Send/Amount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,9 @@ const Amount = ({ navigation }: SendScreenProps<'Amount'>): ReactElement => {
useEffect(() => {
const result = getNumberPadText(outputAmount, unit);
setText(result);
}, [
transaction.outputs,
outputAmount,
selectedWallet,
selectedNetwork,
unit,
]);
// Only update this if the outputs/wallet/network changes, so we can ignore unit in the dependency array.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [transaction.outputs, outputAmount, selectedWallet, selectedNetwork]);

const amount = useMemo((): number => {
return convertToSats(text, unit);
Expand Down

0 comments on commit 5b64da8

Please sign in to comment.