From 403aadd8239d805b293320c072e24bd4b671d748 Mon Sep 17 00:00:00 2001 From: Christian Kaisermann Date: Mon, 18 Nov 2019 11:18:29 -0300 Subject: [PATCH] Set the useGeolocation flag when using geolocation --- .vscode/settings.json | 1 - CHANGELOG.md | 4 ++++ react/components/Addresses/AddressForm.tsx | 12 ++++++------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b2075760..416a63dd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,5 @@ { "editor.formatOnSave": true, - "prettier.eslintIntegration": true, "eslint.validate": [ { "language": "javascript", diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a480340..2924fc80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed + +- Invisible postal code invalidation when editing an address. + ## [0.30.0] - 2019-11-13 ### Added diff --git a/react/components/Addresses/AddressForm.tsx b/react/components/Addresses/AddressForm.tsx index 92f534f6..d00cd48c 100644 --- a/react/components/Addresses/AddressForm.tsx +++ b/react/components/Addresses/AddressForm.tsx @@ -69,14 +69,11 @@ class AddressForm extends Component { // allow to edit only with geolocation component if ( this.hasGeolocationPreference() && - curAddress.postalCode && - curAddress.postalCode.geolocationAutoCompleted && - newAddress.postalCode && - !newAddress.postalCode.geolocationAutoCompleted + newAddress.addressQuery && + !newAddress.addressQuery.geolocationAutoCompleted ) { AUTO_COMPLETABLE_FIELDS.forEach(field => { newAddress[field].value = null - delete newAddress[field].geolocationAutoCompleted delete newAddress[field].valid }) } @@ -145,7 +142,10 @@ class AddressForm extends Component { const hasAutoCompletedFields = this.hasAutoCompletedFields() return ( - +