mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 05:00:43 +10:00
Fix: make sure that map refreshment token is changed after reattaching
the map.
This commit is contained in:
parent
13f5e9b79d
commit
1baea00dad
1 changed files with 10 additions and 3 deletions
|
|
@ -45,8 +45,12 @@ export class SearchMapComponent extends Component {
|
|||
|
||||
this.listings = [];
|
||||
this.mapRef = null;
|
||||
this.mapReattachmentCount = 0;
|
||||
this.state = { infoCardOpen: null };
|
||||
|
||||
if (typeof window !== 'undefined' && !window.mapReattachmentCount) {
|
||||
window.mapReattachmentCount = 0;
|
||||
}
|
||||
const mapReattachmentCount = window.mapReattachmentCount || 0;
|
||||
this.state = { infoCardOpen: null, mapReattachmentCount };
|
||||
|
||||
this.createURLToListing = this.createURLToListing.bind(this);
|
||||
this.onListingInfoCardClicked = this.onListingInfoCardClicked.bind(this);
|
||||
|
|
@ -135,7 +139,10 @@ export class SearchMapComponent extends Component {
|
|||
const infoCardOpen = this.state.infoCardOpen;
|
||||
|
||||
const forceUpdateHandler = () => {
|
||||
this.mapReattachmentCount += 1;
|
||||
// Update global reattachement count
|
||||
window.mapReattachmentCount += 1;
|
||||
// Initiate rerendering
|
||||
this.setState({ mapReattachmentCount: window.mapReattachmentCount });
|
||||
};
|
||||
|
||||
// Using Google Maps as map provider should use following component
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue