Skip to content

Commit

Permalink
fix(waste): avoid empty zip space in suggestions
Browse files Browse the repository at this point in the history
SVA-1348
  • Loading branch information
donni106 committed Sep 26, 2024
1 parent 4ca4961 commit 21bf3bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/screens/WasteCollectionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const WasteCollectionScreen = ({ navigation }) => {
return address.street || '';
}

return `${address.street} (${address.zip} ${address.city})`;
return `${address.street} (${[address.zip, address.city].filter(Boolean).join(' ')})`;
},
[wasteAddressesTwoStep]
);
Expand All @@ -151,7 +151,7 @@ export const WasteCollectionScreen = ({ navigation }) => {
// return empty list on an exact match (except for capitalization)
const filterStreets = useCallback(
(currentInputValue, addressesData) => {
if (wasteAddressesTwoStep && inputValueCity === '') return [];
if (wasteAddressesTwoStep && a === '') return [];
if (isInputAutoFocus && currentInputValue === '' && !isStreetInputFocused) return [];

const streets = addressesData
Expand Down

0 comments on commit 21bf3bb

Please sign in to comment.