anza-xyz / anza-xyz/wallet-adapter
Explore whether mid-session wallet installation is detectable by focus-tracking the Window object
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2k
- Forks
- 1.1k
- Ø Merge
- 10 Std. 19 Min.
- Gemergte PRs (30 T.)
- 3
Beschreibung
_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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.