debug(gps): Logs fuer Standort-Abfrage und Permission-Fehler

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 14:53:32 +02:00
parent 43c21d3ddc
commit a6638c0108
+10 -4
View File
@@ -725,17 +725,23 @@ const ChatScreen: React.FC = () => {
// GPS-Position holen (optional) // GPS-Position holen (optional)
const getCurrentLocation = useCallback((): Promise<{ lat: number; lon: number } | null> => { const getCurrentLocation = useCallback((): Promise<{ lat: number; lon: number } | null> => {
if (!gpsEnabled) return Promise.resolve(null); if (!gpsEnabled) {
console.log('[GPS] gpsEnabled=false → kein Standort');
return Promise.resolve(null);
}
return new Promise((resolve) => { return new Promise((resolve) => {
Geolocation.getCurrentPosition( Geolocation.getCurrentPosition(
(position) => { (position) => {
resolve({ const loc = {
lat: position.coords.latitude, lat: position.coords.latitude,
lon: position.coords.longitude, lon: position.coords.longitude,
}); };
console.log('[GPS] Position: lat=%s lon=%s', loc.lat, loc.lon);
resolve(loc);
}, },
(_error) => { (error) => {
console.warn('[GPS] getCurrentPosition Fehler:', error?.code, error?.message);
resolve(null); resolve(null);
}, },
{ enableHighAccuracy: false, timeout: 5000 }, { enableHighAccuracy: false, timeout: 5000 },