We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nasa.user.getAddr()
我只是在测试中发现了一个现象,暂时没有深入阅读钱包扩展的源码。
在每个交互周期内(页面 → 钱包扩展 → 页面),NasExtWallet.getUserAddress() 方法只能承载一个回调。也就是说,连续多次调用 NasExtWallet.getUserAddress(callback),最后一次注册的 callback 会覆盖之前的所有 callback。
NasExtWallet.getUserAddress()
NasExtWallet.getUserAddress(callback)
比如有以下代码:
NasExtWallet.getUserAddress(function () { console.log(1) }) NasExtWallet.getUserAddress(function () { console.log(2) }) NasExtWallet.getUserAddress(function () { console.log(3) }) NasExtWallet.getUserAddress(function () { console.log(4) })
会在控制台得到 4 4 4 4,而不是 1 2 3 4。
4
1
2
3
The text was updated successfully, but these errors were encountered:
.user.getAddr()
为绕过此 bug,Nasa.user.getAddr() 需要短时间缓存取到的用户地址,避免重复调用 NasExtWallet.getUserAddress() 且回调被覆盖的情况。
Sorry, something went wrong.
计划在 v0.2.0-beta.3 修复此问题。
计划在 v0.2.x 修复此问题。
No branches or pull requests
我只是在测试中发现了一个现象,暂时没有深入阅读钱包扩展的源码。
在每个交互周期内(页面 → 钱包扩展 → 页面),
NasExtWallet.getUserAddress()
方法只能承载一个回调。也就是说,连续多次调用NasExtWallet.getUserAddress(callback)
,最后一次注册的 callback 会覆盖之前的所有 callback。比如有以下代码:
会在控制台得到
4
4
4
4
,而不是1
2
3
4
。The text was updated successfully, but these errors were encountered: