Skip to content

Commit

Permalink
Fix lint warnings in address discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
nop33 committed Mar 4, 2025
1 parent 9a2c7a4 commit 1d96078
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions apps/mobile-wallet/src/screens/AddressDiscoveryScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,16 @@ const AddressDiscoveryScreen = ({ navigation, route: { params }, ...props }: Scr
}

useEffect(() => {
discoveredAddresses.forEach(({ hash }) => {
if (addressSelections[hash] === undefined) {
setAddressSelections({ ...addressSelections, [hash]: true })
}
setAddressSelections((prevSelections) => {
const newSelections = { ...prevSelections }

discoveredAddresses.forEach(({ hash }) => {
if (newSelections[hash] === undefined) {
newSelections[hash] = true
}
})
return newSelections
})

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [discoveredAddresses])

const handleStartScanPress = () => {
Expand Down

0 comments on commit 1d96078

Please sign in to comment.