(Fix) Duplicated address validation#1699
Conversation
as memoization in this scenario is not working as expected and list is not refreshed
- `selectedEntry` being `null` made the code harder to follow -
|
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
|
Travis automatic deployment: |
1 similar comment
|
Travis automatic deployment: |
|
Travis automatic deployment: |
src/components/forms/validator.ts
Outdated
|
|
||
| return undefined | ||
| export const uniqueAddress = (addresses: string[] | List<string> = []) => (address?: string): string | undefined => { | ||
| const addressExists = addresses.some(sameAddress.bind(null, address)) |
There was a problem hiding this comment.
I feel I have some readability issues here. I would do it in one more line but more explicit what is happening here.
const addressExists = addresses.some((addressFromList) => {
return sameAddress(addressFromList, address)
})
What do you think?
There was a problem hiding this comment.
😆 Yes, sure.
To be honest, I came looking for this comment.
I must have been nostalgic when I did
|
Travis automatic deployment: |
|
Travis automatic deployment: |
This PR closes #1673, by:
addressBookAddressesListSelector(see 52315cd)The rest was me trying to understand what was going on and trying to fix the AddressBook issue. After fixing the selector issue, I checked the Owner's related bugs and all were fixed as well.
In regard to the
createSelector, I tried usingcreateSelectorCreator, with different strategies (usinglodash.memoize,defaultMemoize, with different setups) with no luck.I prefer having these calls memoized, but couldn't make it work for the time being.