Geolocation error is not reset after success
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 50/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- react, typescript
- Ambito
- mobile-dev
Direzione di ricerca
Inizia dal callback Geolocation.watchPosition negli hook useCurrentPosition e useWatchPosition, quindi riproduci la sequenza di disabilitazione e ripristino dei permessi descritta nell’issue. Il lavoro è completato quando una posizione ottenuta correttamente non lascia più l’errore precedente nello stato restituito dall’hook.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
The Geolocation error is still being returned from both useCurrentPosition and useWatchPosition hooks, even that the position has been read.
To Reproduce
- Disable location permission
- Use any of the Geolocation hooks
- It returns an object
{ currentPosition: undefined, error: Error } - Enable location permission
- Use any of the Geolocation hooks
- It reruns and object
{ currentPosition: GeolocationPosition, error: Error }
Expected behavior
Hooks should not return error when it does not happen
Screenshots
Desktop (please complete the following information):
- OS: Windows
- Browser Chrome
- Version 126.0.6478.127
Smartphone (please complete the following information):
Not tested
Additional context
Hooks should reset the error state on success:
const id = await Geolocation.watchPosition(options || {}, (pos: Position | null, err) => {
- if (err) {
- setError(err);
- }
+ setError(err);
if (pos) {
setCurrentPosition(pos);
}
});
- Lingua principale
- TypeScript
- Stelle
- 267
- Fork
- 24
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di capacitor-community/react-hooks
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 10/100
capacitor-community/react-hooks#56 · 1 commento · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 42/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
capacitor-community/react-hooks#53 · 2 commenti ·
-
Capacitor v4 SupportAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
capacitor-community/react-hooks#47 · 2 commenti · 1 reazione ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di capacitor-community/react-hooks
Issue simili
-
Mend: dependency security vulnerability untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
opensearch-project/security-dashboards-plugin#2545 ·
I maintainer di solito rispondono entro 1 giorno
-
Add: Dream TR SDApertacheck:passed streams:add
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
doctor integrity sample scans soft-deleted pages on Postgres (batch path has no deleted_at filter)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
SocialGouv/egapro#4672 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
area:agents area:tui bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
anthropics/claude-code#98358 ·
I maintainer di solito rispondono entro 1 giorno