From d11a767383bf43e222d36b4e26997ac9f8171cc1 Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Fri, 7 Oct 2022 22:14:59 -0400 Subject: [PATCH 1/5] scanNext fixes - Move scan dialog into its own component - Move constants out of ScanNextTarget fn - Wrap a lot of state changes in useEffects to control renders --- .../layout/dialogs/scanner/ScanDialog.jsx | 40 +++++++ .../layout/dialogs/scanner/ScanNext.jsx | 102 ++++++++---------- .../layout/dialogs/scanner/ScanNextTarget.jsx | 55 +++++----- 3 files changed, 113 insertions(+), 84 deletions(-) create mode 100644 src/components/layout/dialogs/scanner/ScanDialog.jsx diff --git a/src/components/layout/dialogs/scanner/ScanDialog.jsx b/src/components/layout/dialogs/scanner/ScanDialog.jsx new file mode 100644 index 000000000..e99d9ed99 --- /dev/null +++ b/src/components/layout/dialogs/scanner/ScanDialog.jsx @@ -0,0 +1,40 @@ +import * as React from 'react' +import { Dialog, DialogContent, Grid, Typography } from '@material-ui/core' +import { useTranslation } from 'react-i18next' +import Header from '@components/layout/general/Header' +import Footer from '@components/layout/general/Footer' + +export default function ScanDialog({ scanNextMode, setScanNextMode }) { + const { t } = useTranslation() + + return ( + setScanNextMode(false)} + open={['confirmed', 'loading', 'error'].includes(scanNextMode)} + maxWidth="xs" + > +
setScanNextMode(false)} + /> + + + + {t(`scan_${scanNextMode}`)} + + + +
+ ) +} diff --git a/src/components/layout/dialogs/scanner/ScanNext.jsx b/src/components/layout/dialogs/scanner/ScanNext.jsx index 51d92cc0a..9d974f57d 100644 --- a/src/components/layout/dialogs/scanner/ScanNext.jsx +++ b/src/components/layout/dialogs/scanner/ScanNext.jsx @@ -1,19 +1,9 @@ import React, { useEffect, useState } from 'react' import { useQuery, useLazyQuery } from '@apollo/client' -import { useTranslation } from 'react-i18next' -import { - Dialog, - DialogContent, - DialogTitle, - DialogActions, - Button, - Grid, - Typography, -} from '@material-ui/core' - import { useStatic, useStore } from '@hooks/useStore' import Query from '@services/Query' import ScanNextTarget from './ScanNextTarget' +import ScanDialog from './ScanDialog' export default function ScanNext({ map, @@ -26,16 +16,16 @@ export default function ScanNext({ scanNextAreaRestriction, }, }) { - const { data: scanAreas } = scanNextAreaRestriction?.length - ? useQuery(Query.scanAreas()) - : { data: null } const { loggedIn } = useStatic((state) => state.auth) - const { t } = useTranslation() + const location = useStore((s) => s.location) + const [queue, setQueue] = useState('init') const [scanNextLocation, setScanNextLocation] = useState(location) const [scanNextCoords, setScanNextCoords] = useState([location]) const [scanNextType, setScanNextType] = useState('S') + + const { data: scanAreas } = useQuery(Query.scanAreas()) const [scanNext, { error: scannerError, data: scannerResponse }] = useLazyQuery(Query.scanner(), { variables: { @@ -68,39 +58,48 @@ export default function ScanNext({ }, ) - if (scanNextMode === 'sendCoords') { - scanNext() - setScanNextMode('loading') - } - if (scannerError) { - setScanNextMode('error') - } - if (scannerResponse) { - if (scannerResponse.scanner?.status === 'ok') { - setScanNextMode('confirmed') - } else { - setScanNextMode('error') + useEffect(() => { + if (scanNextMode === 'sendCoords') { + scanNext() + setScanNextMode('loading') } - } + }, [scanNextMode]) - if (scanNextShowScanQueue) { - if (queue === 'init') { - getQueue() - setQueue('...') + useEffect(() => { + if (scannerError) { + setScanNextMode('error') } - useEffect(() => { - const timer = setInterval(() => { + if (scannerResponse) { + if (scannerResponse?.scanner?.status === 'ok') { + setScanNextMode('confirmed') + } else { + setScanNextMode('error') + } + } + }, [scannerError, !!scannerResponse]) + + useEffect(() => { + let timer + if (scanNextShowScanQueue) { + if (queue === 'init') { + getQueue() + setQueue('...') + } + timer = setInterval(() => { if (scanNextMode === 'setLocation') { getQueue() } }, 2000) - return () => clearInterval(timer) - }) - } - if (scannerQueueResponse && scannerQueueResponse.scanner?.status === 'ok') { - setQueue(scannerQueueResponse.scanner.message) - scannerQueueResponse.scanner = {} - } + } + return () => timer ? clearInterval(timer) : null + }) + + useEffect(() => { + if (scannerQueueResponse?.scanner?.status === 'ok') { + setQueue(scannerQueueResponse.scanner.message) + scannerQueueResponse.scanner = {} + } + }, [!!scannerQueueResponse?.scanner]) return ( <> @@ -122,23 +121,10 @@ export default function ScanNext({ scanAreas={scanAreas ? scanAreas.scanAreas[0]?.features : null} /> )} - setScanNextMode(false)} - open={['confirmed', 'loading', 'error'].includes(scanNextMode)} - maxWidth="xs" - > - {t(`scan_${scanNextMode}_title`)} - - - - {t(`scan_${scanNextMode}`)} - - - - - - - + ) } diff --git a/src/components/layout/dialogs/scanner/ScanNextTarget.jsx b/src/components/layout/dialogs/scanner/ScanNextTarget.jsx index cbcf04a69..0dc4512c1 100644 --- a/src/components/layout/dialogs/scanner/ScanNextTarget.jsx +++ b/src/components/layout/dialogs/scanner/ScanNextTarget.jsx @@ -6,6 +6,31 @@ import booleanPointInPolygon from '@turf/boolean-point-in-polygon' import { Circle, Marker, Popup } from 'react-leaflet' import { useTranslation } from 'react-i18next' +const RADIUS_POKEMON = 70 +const RADIUS_GYM = 750 +const DISTANCE = { + M: RADIUS_POKEMON * 1.732, + XL: RADIUS_GYM * 1.732, +} + +const calcScanNextCoords = (center, type) => { + const coords = [center] + if (type === 'S') return coords + const start = point([center[1], center[0]]) + const options = { units: 'kilometers' } + return coords.concat( + [0, 60, 120, 180, 240, 300].map((bearing) => { + const [lon, lat] = destination( + start, + DISTANCE[type] / 1000, + bearing, + options, + ).geometry.coordinates + return [lat, lon] + }), + ) +} + export default function ScanNextTarget({ map, scannerType, @@ -23,29 +48,7 @@ export default function ScanNextTarget({ scanAreas, }) { const [position, setPosition] = useState(scanNextLocation) - const radiusPokemon = 70 - const radiusGym = 750 - const calcScanNextCoords = (center, type) => { - const coords = [center] - if (type === 'S') return coords - const start = point([center[1], center[0]]) - const distance = { - M: radiusPokemon * 1.732, - XL: radiusGym * 1.732, - } - const options = { units: 'kilometers' } - return coords.concat( - [0, 60, 120, 180, 240, 300].map((bearing) => { - const [lon, lat] = destination( - start, - distance[type] / 1000, - bearing, - options, - ).geometry.coordinates - return [lat, lon] - }), - ) - } + const checkAreaValidity = (center) => { if (!scanNextAreaRestriction?.length || !scanAreas?.length) return true let isValid = false @@ -188,7 +191,7 @@ export default function ScanNextTarget({ {scanNextCoords.map((coords) => ( ( Date: Fri, 7 Oct 2022 22:32:19 -0400 Subject: [PATCH 2/5] dry up a lot of code - Consolidate repeat functions - Consolidate repeat dialog --- .../layout/dialogs/scanner/ScanDialog.jsx | 14 +- .../layout/dialogs/scanner/ScanNext.jsx | 7 +- .../layout/dialogs/scanner/ScanNextTarget.jsx | 34 +---- .../layout/dialogs/scanner/ScanZone.jsx | 38 +----- .../layout/dialogs/scanner/ScanZoneTarget.jsx | 129 ++++++++---------- src/services/Utility.js | 5 + src/services/functions/checkAreaValidity.js | 26 ++++ 7 files changed, 113 insertions(+), 140 deletions(-) create mode 100644 src/services/functions/checkAreaValidity.js diff --git a/src/components/layout/dialogs/scanner/ScanDialog.jsx b/src/components/layout/dialogs/scanner/ScanDialog.jsx index e99d9ed99..7b866f7ab 100644 --- a/src/components/layout/dialogs/scanner/ScanDialog.jsx +++ b/src/components/layout/dialogs/scanner/ScanDialog.jsx @@ -4,23 +4,23 @@ import { useTranslation } from 'react-i18next' import Header from '@components/layout/general/Header' import Footer from '@components/layout/general/Footer' -export default function ScanDialog({ scanNextMode, setScanNextMode }) { +export default function ScanDialog({ scanMode, setScanMode }) { const { t } = useTranslation() return ( setScanNextMode(false)} - open={['confirmed', 'loading', 'error'].includes(scanNextMode)} + onClose={() => setScanMode(false)} + open={['confirmed', 'loading', 'error'].includes(scanMode)} maxWidth="xs" >
setScanNextMode(false)} + titles={[`scan_${scanMode}_title`]} + action={() => setScanMode(false)} /> - {t(`scan_${scanNextMode}`)} + {t(`scan_${scanMode}`)} @@ -31,7 +31,7 @@ export default function ScanDialog({ scanNextMode, setScanNextMode }) { icon: 'Clear', color: 'primary', align: 'right', - action: () => setScanNextMode(false), + action: () => setScanMode(false), }, ]} /> diff --git a/src/components/layout/dialogs/scanner/ScanNext.jsx b/src/components/layout/dialogs/scanner/ScanNext.jsx index 9d974f57d..ea3f50a8a 100644 --- a/src/components/layout/dialogs/scanner/ScanNext.jsx +++ b/src/components/layout/dialogs/scanner/ScanNext.jsx @@ -91,7 +91,7 @@ export default function ScanNext({ } }, 2000) } - return () => timer ? clearInterval(timer) : null + return () => (timer ? clearInterval(timer) : null) }) useEffect(() => { @@ -121,10 +121,7 @@ export default function ScanNext({ scanAreas={scanAreas ? scanAreas.scanAreas[0]?.features : null} /> )} - + ) } diff --git a/src/components/layout/dialogs/scanner/ScanNextTarget.jsx b/src/components/layout/dialogs/scanner/ScanNextTarget.jsx index 0dc4512c1..159e1dbb3 100644 --- a/src/components/layout/dialogs/scanner/ScanNextTarget.jsx +++ b/src/components/layout/dialogs/scanner/ScanNextTarget.jsx @@ -1,10 +1,10 @@ import React, { useState, useRef, useMemo, useEffect } from 'react' import { Grid, Button, ButtonGroup, Typography } from '@material-ui/core' -import { point, polygon } from '@turf/helpers' +import { point } from '@turf/helpers' import destination from '@turf/destination' -import booleanPointInPolygon from '@turf/boolean-point-in-polygon' import { Circle, Marker, Popup } from 'react-leaflet' import { useTranslation } from 'react-i18next' +import Utility from '@services/Utility' const RADIUS_POKEMON = 70 const RADIUS_GYM = 750 @@ -49,30 +49,6 @@ export default function ScanNextTarget({ }) { const [position, setPosition] = useState(scanNextLocation) - const checkAreaValidity = (center) => { - if (!scanNextAreaRestriction?.length || !scanAreas?.length) return true - let isValid = false - if (scanNextAreaRestriction?.length && scanAreas?.length) { - const testPoint = point([center[1], center[0]]) - scanNextAreaRestriction.map((area) => { - if ( - scanAreas.some( - (scanArea) => - scanArea.properties.name === area && - booleanPointInPolygon( - testPoint, - polygon(scanArea.geometry.coordinates), - ), - ) - ) { - isValid = true - } - return true - }) - } - return isValid - } - const { t } = useTranslation() const scanMarkerRef = useRef(null) const scanPopupRef = useRef(null) @@ -103,7 +79,11 @@ export default function ScanNextTarget({ } }, []) - const isInAllowedArea = checkAreaValidity(position) + const isInAllowedArea = Utility.checkAreaValidity( + position, + scanNextAreaRestriction, + scanAreas, + ) return ( <> diff --git a/src/components/layout/dialogs/scanner/ScanZone.jsx b/src/components/layout/dialogs/scanner/ScanZone.jsx index 1fec1acef..dadedcb80 100644 --- a/src/components/layout/dialogs/scanner/ScanZone.jsx +++ b/src/components/layout/dialogs/scanner/ScanZone.jsx @@ -1,19 +1,9 @@ import React, { useEffect, useState } from 'react' import { useQuery, useLazyQuery } from '@apollo/client' -import { useTranslation } from 'react-i18next' -import { - Dialog, - DialogContent, - DialogTitle, - DialogActions, - Button, - Grid, - Typography, -} from '@material-ui/core' - import { useStatic, useStore } from '@hooks/useStore' import Query from '@services/Query' import ScanZoneTarget from './ScanZoneTarget' +import ScanDialog from './ScanDialog' export default function ScanZone({ map, @@ -31,16 +21,16 @@ export default function ScanZone({ scanZoneAreaRestriction, }, }) { - const { data: scanAreas } = scanZoneAreaRestriction?.length - ? useQuery(Query.scanAreas()) - : { data: null } const { loggedIn } = useStatic((state) => state.auth) - const { t } = useTranslation() + const location = useStore((s) => s.location) + const [queue, setQueue] = useState('init') const [scanZoneLocation, setScanZoneLocation] = useState(location) const [scanZoneCoords, setScanZoneCoords] = useState([location]) const [scanZoneSize, setScanZoneSize] = useState(1) + + const { data: scanAreas } = useQuery(Query.scanAreas()) const [scanZone, { error: scannerError, data: scannerResponse }] = useLazyQuery(Query.scanner(), { variables: { @@ -132,23 +122,7 @@ export default function ScanZone({ scanAreas={scanAreas ? scanAreas.scanAreas[0]?.features : null} /> )} - setScanZoneMode(false)} - open={['confirmed', 'loading', 'error'].includes(scanZoneMode)} - maxWidth="xs" - > - {t(`scan_${scanZoneMode}_title`)} - - - - {t(`scan_${scanZoneMode}`)} - - - - - - - + ) } diff --git a/src/components/layout/dialogs/scanner/ScanZoneTarget.jsx b/src/components/layout/dialogs/scanner/ScanZoneTarget.jsx index 272d94ca4..7df4de954 100644 --- a/src/components/layout/dialogs/scanner/ScanZoneTarget.jsx +++ b/src/components/layout/dialogs/scanner/ScanZoneTarget.jsx @@ -1,11 +1,46 @@ import React, { useState, useRef, useMemo, useEffect } from 'react' import { Grid, Button, Box, Slider, Typography } from '@material-ui/core' -import { point, polygon } from '@turf/helpers' +import { point } from '@turf/helpers' import destination from '@turf/destination' -import booleanPointInPolygon from '@turf/boolean-point-in-polygon' import { Circle, Marker, Popup } from 'react-leaflet' import { useTranslation } from 'react-i18next' import AdvancedAccordion from '@components/layout/custom/AdvancedAccordion' +import Utility from '@services/Utility' + +const calcScanZoneCoords = (center, radius, spacing, scanZoneSize) => { + let coords = [center] + let currentPoint = point([center[1], center[0]]) + const distance = radius * 2 * Math.cos(30 * (Math.PI / 180)) + const bearings = { + 1: 30, + 2: 90, + 3: 150, + 4: 210, + 5: 270, + 6: 330, + } + for (let i = 1; i < scanZoneSize + 1; i += 1) { + let quadrant = 1 + let step = 1 + while (step < 6 * i + 1) { + currentPoint = destination( + currentPoint, + (distance * spacing) / 1000, + step === 1 ? 330 : bearings[quadrant], + { units: 'kilometers' }, + ) + coords = coords.concat([ + [ + currentPoint.geometry.coordinates[1], + currentPoint.geometry.coordinates[0], + ], + ]) + quadrant = Math.floor(step / i) + 1 + step += 1 + } + } + return coords +} export default function ScanZoneTarget({ map, @@ -31,64 +66,6 @@ export default function ScanZoneTarget({ const [position, setPosition] = useState(scanZoneLocation) const [spacing, setSpacing] = useState(scanZoneSpacing) const [radius, setRadius] = useState(scanZoneRadius.pokemon) - const calcScanZoneCoords = (center) => { - let coords = [center] - let currentPoint = point([center[1], center[0]]) - const distance = radius * 2 * Math.cos(30 * (Math.PI / 180)) - const bearings = { - 1: 30, - 2: 90, - 3: 150, - 4: 210, - 5: 270, - 6: 330, - } - for (let i = 1; i < scanZoneSize + 1; i += 1) { - let quadrant = 1 - let step = 1 - while (step < 6 * i + 1) { - currentPoint = destination( - currentPoint, - (distance * spacing) / 1000, - step === 1 ? 330 : bearings[quadrant], - { units: 'kilometers' }, - ) - coords = coords.concat([ - [ - currentPoint.geometry.coordinates[1], - currentPoint.geometry.coordinates[0], - ], - ]) - quadrant = Math.floor(step / i) + 1 - step += 1 - } - } - return coords - } - - const checkAreaValidity = (center) => { - if (!scanZoneAreaRestriction?.length || !scanAreas?.length) return true - let isValid = false - if (scanZoneAreaRestriction?.length && scanAreas?.length) { - const testPoint = point([center[1], center[0]]) - scanZoneAreaRestriction.map((area) => { - if ( - scanAreas.some( - (scanArea) => - scanArea.properties.name === area && - booleanPointInPolygon( - testPoint, - polygon(scanArea.geometry.coordinates), - ), - ) - ) { - isValid = true - } - return true - }) - } - return isValid - } const { t } = useTranslation() const scanMarkerRef = useRef(null) @@ -102,7 +79,9 @@ export default function ScanZoneTarget({ map.flyTo([lat, lng]) setPosition([lat, lng]) setScanZoneLocation([lat, lng]) - setScanZoneCoords(calcScanZoneCoords([lat, lng])) + setScanZoneCoords( + calcScanZoneCoords([lat, lng], radius, spacing, scanZoneSize), + ) const popup = scanPopupRef.current if (popup) { popup.openOn(map) @@ -120,19 +99,25 @@ export default function ScanZoneTarget({ } }, []) - const handleSizeChange = (event, newSize) => { + const handleSizeChange = (_event, newSize) => { setScanZoneSize(newSize) - setScanZoneCoords(calcScanZoneCoords(position)) + setScanZoneCoords( + calcScanZoneCoords(position, radius, spacing, scanZoneSize), + ) } - const handleSpacingChange = (event, newSpacing) => { + const handleSpacingChange = (_event, newSpacing) => { setSpacing(newSpacing) - setScanZoneCoords(calcScanZoneCoords(position)) + setScanZoneCoords( + calcScanZoneCoords(position, radius, spacing, scanZoneSize), + ) } - const handleRadiusChange = (event, newRadius) => { + const handleRadiusChange = (_event, newRadius) => { setRadius(newRadius) - setScanZoneCoords(calcScanZoneCoords(position)) + setScanZoneCoords( + calcScanZoneCoords(position, radius, spacing, scanZoneSize), + ) } const rangeMarks = [ @@ -140,10 +125,16 @@ export default function ScanZoneTarget({ { value: scanZoneRadius.gym, label: t('gym') }, ] - const isInAllowedArea = checkAreaValidity(position) + const isInAllowedArea = Utility.checkAreaValidity( + position, + scanZoneAreaRestriction, + scanAreas, + ) if (scanZoneCoords.length === 1) { - setScanZoneCoords(calcScanZoneCoords(scanZoneLocation)) + setScanZoneCoords( + calcScanZoneCoords(scanZoneLocation, radius, spacing, scanZoneSize), + ) } const advancedMenu = ( diff --git a/src/services/Utility.js b/src/services/Utility.js index 9c053e564..58bece40a 100644 --- a/src/services/Utility.js +++ b/src/services/Utility.js @@ -9,6 +9,7 @@ import dayCheck from './functions/dayCheck' import parseQuestConditions from './functions/parseConditions' import formatter from './functions/formatter' import getRewardInfo from './functions/getRewardInfo' +import checkAreaValidity from './functions/checkAreaValidity' export default class Utility { static getProperName(word) { @@ -148,4 +149,8 @@ export default class Utility { ? content[localStorage.getItem('i18nextLng')] || Object.values(content)[0] : '' } + + static checkAreaValidity(...args) { + return checkAreaValidity(...args) + } } diff --git a/src/services/functions/checkAreaValidity.js b/src/services/functions/checkAreaValidity.js new file mode 100644 index 000000000..86cc38ce7 --- /dev/null +++ b/src/services/functions/checkAreaValidity.js @@ -0,0 +1,26 @@ +import { point, polygon } from '@turf/helpers' +import booleanPointInPolygon from '@turf/boolean-point-in-polygon' + +export default function checkAreaValidity(center, areaRestrictions, scanAreas) { + if (!areaRestrictions?.length || !scanAreas?.length) return true + let isValid = false + if (areaRestrictions?.length && scanAreas?.length) { + const testPoint = point([center[1], center[0]]) + areaRestrictions.map((area) => { + if ( + scanAreas.some( + (scanArea) => + scanArea.properties.name === area && + booleanPointInPolygon( + testPoint, + polygon(scanArea.geometry.coordinates), + ), + ) + ) { + isValid = true + } + return true + }) + } + return isValid +} From cdc783ada49d868c5767bdb947e27fb168eb027c Mon Sep 17 00:00:00 2001 From: TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com> Date: Fri, 7 Oct 2022 23:00:37 -0400 Subject: [PATCH 3/5] Consolidate ScanNext & ScanZone components - Consolidate ScanNext and ScanZone components into one reusable component - Cleanup backend code to use more general variables - --- server/src/services/api/scannerApi.js | 16 +- src/components/Map.jsx | 18 +- .../layout/dialogs/scanner/ScanNext.jsx | 127 ------------- .../layout/dialogs/scanner/ScanOnDemand.jsx | 167 ++++++++++++++++++ .../layout/dialogs/scanner/ScanZone.jsx | 128 -------------- 5 files changed, 185 insertions(+), 271 deletions(-) delete mode 100644 src/components/layout/dialogs/scanner/ScanNext.jsx create mode 100644 src/components/layout/dialogs/scanner/ScanOnDemand.jsx delete mode 100644 src/components/layout/dialogs/scanner/ScanZone.jsx diff --git a/server/src/services/api/scannerApi.js b/server/src/services/api/scannerApi.js index dce481ab8..56d0943ab 100644 --- a/server/src/services/api/scannerApi.js +++ b/server/src/services/api/scannerApi.js @@ -37,17 +37,17 @@ module.exports = async function scannerApi(category, method, data = null) { console.log( `[scannerApi] Request to scan new location by ${data.username}${ data.userId ? ` (${data.userId})` : '' - } - type ${data.scanNextType}: ${data.scanNextLocation[0].toFixed( + } - type ${data.scanNextType}: ${data.scanLocation[0].toFixed( 5, - )},${data.scanNextLocation[1].toFixed(5)}`, + )},${data.scanLocation[1].toFixed(5)}`, ) const coords = config.scanner.backendConfig.platform === 'mad' ? `${parseFloat( - data.scanNextCoords[0][0].toFixed(5), - )},${parseFloat(data.scanNextCoords[0][1].toFixed(5))}` + data.scanCoords[0][0].toFixed(5), + )},${parseFloat(data.scanCoords[0][1].toFixed(5))}` : JSON.stringify( - data.scanNextCoords.map((coord) => ({ + data.scanCoords.map((coord) => ({ lat: parseFloat(coord[0].toFixed(5)), lon: parseFloat(coord[1].toFixed(5)), })), @@ -76,12 +76,12 @@ module.exports = async function scannerApi(category, method, data = null) { console.log( `[scannerApi] Request to scan new zone by ${data.username}${ data.userId ? ` (${data.userId})` : '' - } - size ${data.scanZoneSize}: ${data.scanZoneLocation[0].toFixed( + } - size ${data.scanZoneSize}: ${data.scanLocation[0].toFixed( 5, - )},${data.scanZoneLocation[1].toFixed(5)}`, + )},${data.scanLocation[1].toFixed(5)}`, ) const coords = JSON.stringify( - data.scanZoneCoords.map((coord) => ({ + data.scanCoords.map((coord) => ({ lat: parseFloat(coord[0].toFixed(5)), lon: parseFloat(coord[1].toFixed(5)), })), diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 46d9ad7a1..997a07748 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -10,8 +10,7 @@ import { useStatic, useStore } from '@hooks/useStore' import Nav from './layout/Nav' import QueryData from './QueryData' import Webhook from './layout/dialogs/webhooks/Webhook' -import ScanNext from './layout/dialogs/scanner/ScanNext' -import ScanZone from './layout/dialogs/scanner/ScanZone' +import ScanOnDemand from './layout/dialogs/scanner/ScanOnDemand' import ClientError from './layout/dialogs/ClientError' const userSettingsCategory = (category) => { @@ -275,20 +274,23 @@ export default function Map({ ) )} {scanNextMode && ( - )} {scanZoneMode && ( - )}