diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-08-12 15:20:08 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-08-15 10:12:07 +0200 |
| commit | e6270d07adb63e088e388ae7f5fe181c2d767c1a (patch) | |
| tree | 1d17d8bd12f0963076679b12524bfebdc3fa4da0 | |
| parent | 0db6652d222bddf9228794bfd38a8822cc6638b2 (diff) | |
| download | mullvadvpn-e6270d07adb63e088e388ae7f5fe181c2d767c1a.tar.xz mullvadvpn-e6270d07adb63e088e388ae7f5fe181c2d767c1a.zip | |
Fix react compiler lint errors
- By constructing a new coordinate from just the lat/lng of the
connection variable we fix the dependency array lint error,
and as such also the react compiler lint error.
- Remove lint disable comments which reported having no effect on the
next line.
| -rw-r--r-- | desktop/packages/mullvad-vpn/src/renderer/components/Map.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/Map.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/Map.tsx index 674524b21f..d19aa1ae14 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/Map.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/Map.tsx @@ -34,9 +34,12 @@ export default function Map() { const hasLocationValue = hasLocation(connection); const location = useMemo<Coordinate | undefined>(() => { - return hasLocationValue ? connection : defaultLocation; - // eslint-disable-next-line react-compiler/react-compiler - // eslint-disable-next-line react-hooks/exhaustive-deps + return hasLocationValue + ? { + latitude: connection.latitude, + longitude: connection.longitude, + } + : defaultLocation; }, [hasLocationValue, connection.longitude, connection.latitude]); if (window.env.e2e) { @@ -92,11 +95,9 @@ function MapInner(props: MapInnerProps) { const mapRef = useRef<GlMap>(undefined); const canvasRef = useRef<HTMLCanvasElement>(undefined); - // eslint-disable-next-line react-compiler/react-compiler const width = applyPixelRatio(canvasRef.current?.clientWidth ?? window.innerWidth); // This constant is used for the height the first frame that is rendered only. - // eslint-disable-next-line react-compiler/react-compiler const height = applyPixelRatio(canvasRef.current?.clientHeight ?? 493); // Hack to rerender when window size changes or when ref is set. |
