Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Fix clicking on map popup to open device details (#1198)
Browse files Browse the repository at this point in the history
  • Loading branch information
mechaffin authored Dec 11, 2018
1 parent 3c094ee commit 8b20891
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/pages/dashboard/panels/map/mapPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class MapPanel extends Component {
popupContentBox.appendChild(name);

popupContentBox.onclick = () => {
// Check this to void any potential attempts to refernce the component after unmount
// Check this to void any potential attempts to reference the component after unmount
if (this) this.openDeviceDetails(properties.id);
};

Expand Down Expand Up @@ -187,7 +187,7 @@ export class MapPanel extends Component {
closeDeviceDetails = () => this.setState({ selectedDeviceId: undefined });

render() {
const { t, isPending, devices, mapKeyIsPending, azureMapsKey, error } = this.props;
const { t, isPending, mapKeyIsPending, azureMapsKey, error } = this.props;
const showOverlay = !error && isPending && mapKeyIsPending;
return (
<Panel className="map-panel-container">
Expand All @@ -205,7 +205,7 @@ export class MapPanel extends Component {
{ error && <PanelError><AjaxError t={t} error={error} /></PanelError> }
{
this.state.selectedDeviceId
&& <DeviceDetailsContainer onClose={this.closeDeviceDetails} device={devices[this.state.selectedDeviceId]} />
&& <DeviceDetailsContainer onClose={this.closeDeviceDetails} deviceId={this.state.selectedDeviceId} />
}
</Panel>
);
Expand Down

0 comments on commit 8b20891

Please sign in to comment.