Skip to content

Commit

Permalink
Countryclick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corradio committed Oct 24, 2018
1 parent d395d4f commit 5c02222
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,8 @@ if (typeof zoneMap !== 'undefined') {
}
})
.onCountryClick((d) => {
// Analytics
thirdPartyServices.track('countryClick', { countryCode: d.countryCode });
dispatchApplication('isLeftPanelCollapsed', false);
dispatchApplication('showPageState', 'country'); // TODO(olc): infer in reducer?
if (getState().application.selectedZoneName !== d.countryCode) {
Expand Down Expand Up @@ -1266,9 +1268,6 @@ observe(state => state.application.showPageState, (showPageState, state) => {
// Observe for zone change (for example after map click)
observe(state => state.application.selectedZoneName, (selectedZoneName, state) => {
if (!selectedZoneName) { return; }
// Analytics
thirdPartyServices.track('countryClick', { countryCode: selectedZoneName });

// Render
renderCountryTable(state);
renderGauges(state);
Expand Down

0 comments on commit 5c02222

Please sign in to comment.