digidem / comapeo-mobile

The next version of Mapeo mobile
GNU General Public License v3.0
5 stars 0 forks source link

Refactor how location is saved in observation #402

Open ErikSin opened 1 month ago

ErikSin commented 1 month ago

Currently location is being tracked in the LocationView component. This means that the location is only being tracked when the location view is mounted, so it is not being tracked when the user is choosing a preset, editting an observation field, or taking a photo. Also since the LocationView can be unmounted (during all those activities just listed) the most accurate location can be overwritten by the newer location,

To solve this we can tie the subscription of the location to the state of of an observation. That is, when draft observation !== null we can start tracking the observation. This will require us to start the subscription outside of react state.

To Do: