anza-xyz / anza-xyz/wallet-adapter

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

未关闭
#337 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
2k
派生
1.1k
平均合并
10 小时 19 分钟
30 天内合并 PR
3

描述

_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.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。