Sprint3/feature/us2.2/set current location as starting location#212
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| }, [campus]); | ||
|
|
||
| useEffect(() => { | ||
| const getUserBuilding = async () => { |
There was a problem hiding this comment.
Since the user story is “Use current location as starting point” (and AC says “option is available”), it might be better UX to request permission when the user opts in (e.g., taps “Use my location” or opens navigation) rather than on screen mount.
| const loc = await Location.getCurrentPositionAsync({}); | ||
| const { latitude, longitude } = loc.coords; | ||
|
|
||
| const building = findNearestBuilding(latitude, longitude); |
There was a problem hiding this comment.
findNearestBuilding will always return something, even if the user is nowhere near campus. That could set an incorrect start location. Consider adding a distance threshold and only auto-set when the nearest building is within X meters.
There was a problem hiding this comment.
The main purpose of the app is to be a campus navigation system so it doesn't have much use if you're not at either campus so I don't think doing something like this is completely necessary.
|



Closes #7