Skip to content

Commit

Permalink
Fix/rpc middleware (#1503)
Browse files Browse the repository at this point in the history
* fix: handle wallet_requestUnlockUI error

* feat: version
  • Loading branch information
mosshqq authored Jan 7, 2025
1 parent 66fd137 commit 974b9a6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .yarn/versions/59481ef4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
releases:
"@fluent-wallet/rpc-engine": patch
browser-extension: patch
helios-background: patch

declined:
- helios
15 changes: 11 additions & 4 deletions packages/rpc-engine/middlewares/call-rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,17 @@ export default defMiddleware(
)
) {
// allow some inpage rpc methods to request the unlock ui
await req.rpcs.wallet_requestUnlockUI().catch(err => {
err.rpcData = req
throw err
})
await req.rpcs
.wallet_requestUnlockUI(
{
errorFallThrough: true,
},
undefined,
)
.catch(err => {
err.rpcData = req
throw err
})
} else {
// reject others
const err = req.Err.Unauthorized()
Expand Down

0 comments on commit 974b9a6

Please sign in to comment.