Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Live location sharing: remove geoUri logs (#8465)
Browse files Browse the repository at this point in the history
* remove geoUri logs

Signed-off-by: Kerry Archibald <[email protected]>

* Update src/components/views/location/Map.tsx

Co-authored-by: Michael Telatynski <[email protected]>

Co-authored-by: Michael Telatynski <[email protected]>
  • Loading branch information
Kerry and t3chguy authored May 3, 2022
1 parent f280fab commit 3b1e715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/components/views/location/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const useMapWithStyle = ({ id, centerGeoUri, onError, interactive, bounds }) =>
try {
const coords = parseGeoUri(centerGeoUri);
map.setCenter({ lon: coords.longitude, lat: coords.latitude });
} catch (error) {
logger.error('Could not set map center', centerGeoUri);
} catch (_error) {
logger.error('Could not set map center');
}
}
}, [map, centerGeoUri]);
Expand All @@ -65,8 +65,8 @@ const useMapWithStyle = ({ id, centerGeoUri, onError, interactive, bounds }) =>
[bounds.east, bounds.north],
);
map.fitBounds(lngLatBounds, { padding: 100, maxZoom: 15 });
} catch (error) {
logger.error('Invalid map bounds', error);
} catch (_error) {
logger.error('Invalid map bounds');
}
}
}, [map, bounds]);
Expand Down
4 changes: 2 additions & 2 deletions test/components/views/location/Map-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ describe('<Map />', () => {
const logSpy = jest.spyOn(logger, 'error').mockImplementation();
getComponent({ centerGeoUri: '123 Sesame Street' });
expect(mockMap.setCenter).not.toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith('Could not set map center', '123 Sesame Street');
expect(logSpy).toHaveBeenCalledWith('Could not set map center');
});

it('updates map center when centerGeoUri prop changes', () => {
Expand Down Expand Up @@ -133,7 +133,7 @@ describe('<Map />', () => {
const bounds = { north: 'a', south: 'b', east: 42, west: 41 };
getComponent({ bounds });
expect(mockMap.fitBounds).not.toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith('Invalid map bounds', new Error('Invalid LngLat object: (41, NaN)'));
expect(logSpy).toHaveBeenCalledWith('Invalid map bounds');
});

it('updates map bounds when bounds prop changes', () => {
Expand Down

0 comments on commit 3b1e715

Please sign in to comment.