aboutsummaryrefslogtreecommitdiff
path: root/modern/src
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src')
-rw-r--r--modern/src/other/ReplayPage.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/modern/src/other/ReplayPage.js b/modern/src/other/ReplayPage.js
index 67e44105..9d8503a8 100644
--- a/modern/src/other/ReplayPage.js
+++ b/modern/src/other/ReplayPage.js
@@ -1,5 +1,5 @@
import React, {
- useState, useEffect, useRef,
+ useState, useEffect, useRef, useCallback,
} from 'react';
import {
IconButton, Paper, Slider, Toolbar, Typography,
@@ -132,6 +132,10 @@ const ReplayPage = () => {
}
}, [index, positions]);
+ const onMapClick = useCallback((positionId) => {
+ setShowCard(!!positionId);
+ }, [setShowCard]);
+
const handleSubmit = useCatch(async ({ deviceId, from, to }) => {
setSelectedDeviceId(deviceId);
setFrom(from);
@@ -165,7 +169,7 @@ const ReplayPage = () => {
{index < positions.length && (
<MapPositions
positions={[positions[index]]}
- onClick={(positionId) => setShowCard(!!positionId)}
+ onClick={onMapClick}
/>
)}
</MapView>