[SDK] fix: ignore EIP-1193 code 1013 transient disconnect in injected… (#8807)
Co-authored-by: Cursor <[email protected]> Co-authored-by: 0xFirekeeper <[email protected]>
This commit is contained in:
co-authored by
Cursor
0xFirekeeper
parent
8ab8e07fb1
commit
8c521aa06a
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"thirdweb": patch
|
||||
---
|
||||
|
||||
Fix: injected wallets (e.g. MetaMask) no longer fire a spurious `"disconnect"` event for transient EIP-1193 error code 1013 ("disconnected, will reconnect"). Previously, MetaMask's temporary disconnect during chain changes or RPC hiccups would trigger the thirdweb `disconnect` subscriber and tear down wallet state, causing unexpected logouts. The `onDisconnect` handler now ignores code-1013 errors and lets MetaMask reconnect automatically.
|
||||
|
||||
Additionally, the `WalletEmitterEvents["disconnect"]` type is updated from `never` to `WalletDisconnectError | undefined`, so `disconnect` subscribers can inspect the underlying EIP-1193 error code and message when they need to distinguish disconnect causes.
|
||||
Reference in New Issue
Block a user