diff --git a/apps/wallet-mobile/src/features/Receive/common/useReceiveAddressesStatus.tsx b/apps/wallet-mobile/src/features/Receive/common/useReceiveAddressesStatus.tsx index c21e5b8fe1..1a9acdd38f 100644 --- a/apps/wallet-mobile/src/features/Receive/common/useReceiveAddressesStatus.tsx +++ b/apps/wallet-mobile/src/features/Receive/common/useReceiveAddressesStatus.tsx @@ -1,5 +1,3 @@ -import * as React from 'react' - import {useSelectedWallet} from '../../../SelectedWallet' import {AddressMode} from '../../../wallet-manager/types' import {useReceiveAddresses} from '../../../yoroi-wallets/hooks' @@ -16,25 +14,23 @@ export const useReceiveAddressesStatus = (addressMode: AddressMode): Readonly { - const addressesStatus = receiveAddresses.reduce( - (addresses, address) => { - if (wallet.isUsedAddressIndex[address]) { - addresses.used = [...addresses.used, address] - } else { - addresses.unused = [...addresses.unused, address] - } - return addresses - }, - {used: [], unused: []} as Omit, - ) - const multipleAddress = addressesStatus.unused[0] ?? addressesStatus.used[0] - const nextAddress = isSingle ? singleAddress : multipleAddress - const result: ReceiveAddressesStatus = { - used: addressesStatus.used, - unused: addressesStatus.unused, - next: nextAddress, - } as const - return result - }, [isSingle, receiveAddresses, singleAddress, wallet.isUsedAddressIndex]) + const addressesStatus = receiveAddresses.reduce( + (addresses, address) => { + if (wallet.isUsedAddressIndex[address]) { + addresses.used = [...addresses.used, address] + } else { + addresses.unused = [...addresses.unused, address] + } + return addresses + }, + {used: [], unused: []} as Omit, + ) + const multipleAddress = addressesStatus.unused[0] ?? addressesStatus.used[0] + const nextAddress = isSingle ? singleAddress : multipleAddress + const result: ReceiveAddressesStatus = { + used: addressesStatus.used, + unused: addressesStatus.unused, + next: nextAddress, + } as const + return result }