fix(lib): suppress browser alert when geolocation permission denied#822
Merged
antontranelis merged 2 commits intomainfrom Apr 18, 2026
Merged
fix(lib): suppress browser alert when geolocation permission denied#822antontranelis merged 2 commits intomainfrom
antontranelis merged 2 commits intomainfrom
Conversation
- Configure leaflet.locatecontrol with showPopup:false and a no-op onLocationError to stop native browser alerts like "Geolocation error: User denied Geolocation" - Check navigator.permissions before auto-locate on login; skip lc.start() entirely if permission is already denied, so the user isn't prompted or alerted during login Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Check geolocation permission before lc.start() on manual click: if denied, show "Location access denied. Please enable it in your browser settings." toast instead of silently failing - Track manual clicks via manualClickRef so locationerror events only surface a toast when the user actually triggered the action (not during auto-locate which handles its own flow) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a user has disabled geolocation in their browser and logs in, they see a native browser alert like "Geolocation error: User denied Geolocation". This PR prevents that alert and skips the auto-locate attempt entirely if permission is already denied.
Changes
Context
Reported by the user: screenshot showed a browser alert on Ocean Nomads map when geolocation was blocked at browser level. The previous PR (#821) fixed mobile popup bugs but didn't cover the denied-permission case.
Test plan
🤖 Generated with Claude Code