Skip to content

Commit 19651b6

Browse files
committed
fixing unknown activity issue
1 parent 7b7cddf commit 19651b6

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ if (process.env.REACT_APP_PUBLISHABLE_KEY) {
5555
}}
5656
>
5757
<LiveView
58+
onDeviceClick={console.log}
5859
navigateOnClick={false}
5960
publishableKey={process.env.REACT_APP_PUBLISHABLE_KEY}
6061
showTooltips={false}

src/pages/AccountLiveLocation/components/CustomPopup.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export const customPopup = (
1717
name,
1818
timezone,
1919
reversedCoordinates,
20-
notActivePayload
20+
notActivePayload,
21+
activePayload,
22+
disconnectedPayload
2123
) => {
2224
return (
2325
<div className="accountLiveLocationPopupBody">
@@ -44,7 +46,7 @@ export const customPopup = (
4446
<td className="popupTableRowHeader">Activity</td>
4547
<td className="emptyCell" />
4648
<td className="popupTableRowContent">
47-
{device_status.active ? device_status.active.activity : 'unknown'}
49+
{activePayload ? activePayload.activity : 'unknown'}
4850
</td>
4951
</tr>
5052
<tr className="popupTableRow">

src/pages/AccountLiveLocation/components/Map.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const Map = props => {
170170
}
171171

172172
const bindPopup = (leafletMarker, deviceData) => {
173+
leafletMarker.unbindPopup()
173174
const popup = Leaflet.popup()
174175
leafletMarker.on('move', function() {
175176
try {
@@ -187,7 +188,9 @@ const Map = props => {
187188
deviceData.name,
188189
deviceData.timezone,
189190
deviceData.location.geometry.coordinates,
190-
deviceData.inactive
191+
deviceData.inactive,
192+
deviceData.active,
193+
deviceData.disconnected
191194
)
192195
)
193196
)

0 commit comments

Comments
 (0)