Skip to content

Commit

Permalink
add filter logic for addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrizmaselli committed Jun 14, 2024
1 parent 6761c09 commit bf5a158
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fixed

- Filter out "pickup" addresses type temporarily while is still being saved at Profile V2.

## [1.27.1] - 2024-02-15

### Fixed
Expand Down
21 changes: 14 additions & 7 deletions react/components/pages/Addresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,20 @@ class Addresses extends Component<Props> {
<div
className={`${cssHandles.addressBox} flex flex-wrap-ns items-start-ns relative tl`}
>
{this.props.addresses.map(address => (
<AddressBox
key={address.addressId}
address={address}
onEditClick={() => this.handleStartEditing(address)}
/>
))}
{this.props.addresses.map(address => {
// Filter out temporarily addresses with addressType "pickup" because its also saved at Profile V2
if (address.addressType !== 'pickup') {
return (
<AddressBox
key={address.addressId}
address={address}
onEditClick={() => this.handleStartEditing(address)}
/>
)
}

return null
})}

{this.state.showToast && (
<Toast
Expand Down

0 comments on commit bf5a158

Please sign in to comment.