Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add geolocation hooks and mutations #590

Merged
merged 14 commits into from
Jan 29, 2024
Merged

feat: add geolocation hooks and mutations #590

merged 14 commits into from
Jan 29, 2024

Conversation

pyphilia
Copy link
Contributor

close #588

@pyphilia pyphilia self-assigned this Jan 23, 2024
@pyphilia pyphilia marked this pull request as ready for review January 29, 2024 10:22
Copy link
Contributor

@ReidyT ReidyT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

src/hooks/itemGeolocation.ts Outdated Show resolved Hide resolved
src/mutations/item.ts Outdated Show resolved Hide resolved
Copy link
Member

@spaenleh spaenleh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR. Do you think my suggestions make sens ? Would it help reduce the complexity of the code ?

src/api/item.ts Outdated Show resolved Hide resolved
src/api/item.ts Outdated Show resolved Hide resolved
src/api/itemGeolocation.ts Outdated Show resolved Hide resolved
src/api/itemGeolocation.ts Show resolved Hide resolved
src/config/keys.ts Show resolved Hide resolved
Comment on lines +47 to +52
const enabled = Boolean(
(lat1 || lat1 === 0) &&
(lat2 || lat2 === 0) &&
(lng1 || lng1 === 0) &&
(lng2 || lng2 === 0),
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the type here it looks like this condition can never be false ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is false if one of the prop is null, or am I wrong?
On the contrary all values should be set (set at 0 is valid) to be true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ItemGelolocation['lat'] is a number so they can not be null ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right but we never know aha

src/hooks/itemGeolocation.ts Outdated Show resolved Hide resolved
src/mutations/item.ts Outdated Show resolved Hide resolved
src/mutations/item.ts Outdated Show resolved Hide resolved
Copy link

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

1 New issue
0 Security Hotspots
No data about Coverage
7.9% Duplication on New Code

See analysis details on SonarCloud

@pyphilia pyphilia merged commit 48ed281 into main Jan 29, 2024
3 checks passed
@pyphilia pyphilia deleted the 588-geolocation branch January 29, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add geolocation hooks and mutations
3 participants