bilde2910 / Hauk

Open-source realtime location sharing
Apache License 2.0
583 stars 58 forks source link

setting accuracy circle also when acc == null #169

Closed tuffnerdstuff closed 1 month ago

tuffnerdstuff commented 3 years ago

This fix makes sure that an accuracy circle with radius 0 is instantiated even if acc == null, otherwise the missing circle leads to a "Session expired" error further down the line. Although a radius of 0 implies "perfect accuracy", I think other solutions, be it a fixed width circle or a custom icon, are more distracting than helpful. Fixes #165

bilde2910 commented 3 years ago

Thanks for your suggested fix for this issue. The intent behind this code was to only make a circle if there is an accuracy value provided, and not draw any circle at all if that wasn't the case. The problem stems from the periodic location update wrongly assuming that there will always be an accuracy circle - this happens when it checks whether or not a client is "dead", so it can update the color of the marker and circle appropriately. I think this might be a better place to fix the code, so we avoid having the circle in the first place.

tuffnerdstuff commented 3 years ago

OK, I'm now checking if circle !== null instead of setting an accuracy circle with radius = 0