mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 12:43:11 +10:00
Fix: fuzzy location did not change after listing location changed.
This commit is contained in:
parent
767c4c7e84
commit
c66f358aec
2 changed files with 5 additions and 2 deletions
|
|
@ -79,7 +79,9 @@ const reducedToArray = mapListings => {
|
|||
const withCoordinatesObfuscated = listings => {
|
||||
return listings.map(listing => {
|
||||
const { id, attributes, ...rest } = listing;
|
||||
const geolocation = obfuscatedCoordinates(attributes.geolocation, id ? id.uuid : null);
|
||||
const origGeolocation = attributes.geolocation;
|
||||
const cacheKey = id ? `${id.uuid}_${origGeolocation.lat}_${origGeolocation.lng}` : null;
|
||||
const geolocation = obfuscatedCoordinates(origGeolocation, cacheKey);
|
||||
return {
|
||||
id,
|
||||
...rest,
|
||||
|
|
|
|||
|
|
@ -24,9 +24,10 @@ class SectionMapMaybe extends Component {
|
|||
|
||||
const address = publicData.location ? publicData.location.address : '';
|
||||
const classes = classNames(rootClassName || css.sectionMap, className);
|
||||
const cacheKey = listingId ? `${listingId.uuid}_${geolocation.lat}_${geolocation.lng}` : null;
|
||||
|
||||
const mapProps = config.maps.fuzzy.enabled
|
||||
? { obfuscatedCenter: obfuscatedCoordinates(geolocation, listingId ? listingId.uuid : null) }
|
||||
? { obfuscatedCenter: obfuscatedCoordinates(geolocation, cacheKey) }
|
||||
: { address, center: geolocation };
|
||||
const map = <Map {...mapProps} useStaticMap={this.state.isStatic} />;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue