anza-xyz / anza-xyz/wallet-adapter

Explore whether mid-session wallet installation is detectable by focus-tracking the Window object

Aperta
#337 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
2k
Fork
1.1k
Merge medio
10h 19m
PR unite (30g)
3

Descrizione

_Origin: https://github.com/solana-labs/wallet-adapter/pull/327#issuecomment-1052898918_

---

We want to be able to detect when you've installed a new wallet in the middle of a session. Right now, we poll, every second, forever.

I have a hunch that when you're in the middle of a session, and you install a brand new wallet, the mere act of clicking on the installer UI causes the window to `blur` and `focus`. If this is so, we should be able to use the fact of that to detect that a wallet has been installed. Just listen for `focus` events on `window` and do another round of detection for the undetected wallets then!

This is an antidote to having to poll, forever. Polling keeps the process awake, but listening for `focus` lets it sleep.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.