Skip to content

Commit

Permalink
Attempt to fix error showing up by default for scan
Browse files Browse the repository at this point in the history
  • Loading branch information
Perronef5 committed Nov 22, 2024
1 parent 3f512eb commit b574287
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/features/hotspot-onboarding/screens/iot/ScanHotspots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const ScanHotspots = () => {
}

const handleScanPress = useCallback(async () => {
setError(undefined)
const shouldScan = !scanning
setScanning(shouldScan)
await checkPermission()
Expand Down Expand Up @@ -159,9 +160,12 @@ const ScanHotspots = () => {
}, [scannedDevices.length, scanning, startScan, stopScan])

useEffect(() => {
handleScanPress()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
// eslint-disable-next-line no-underscore-dangle
if (carouselRef?.current?._activeItem === 1) {
handleScanPress()
}
// eslint-disable-next-line react-hooks/exhaustive-deps, no-underscore-dangle
}, [carouselRef?.current?._activeItem])

const navNext = useCallback(
() => carouselRef?.current?.snapToNext(),
Expand Down

0 comments on commit b574287

Please sign in to comment.