Skip to content

Commit bf9b51a

Browse files
committed
Merge branch 'main' into jl/add-session-id-to-simple-deeplink
2 parents c07e2c1 + 4ef28cc commit bf9b51a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/connect-evm/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12+
- Eagerly call `onChainChanged` when `switchChain` is called (rather than waiting for the `chainChanged` event), this ensures that the provider's selected chain ID is updated even if the `chainChanged` event is not received ([#62](https://github.com/MetaMask/connect-monorepo/pull/62))
13+
1214
- Fixed incorrect caching of error responses for some requests/events ([#59](https://github.com/MetaMask/connect-monorepo/pull/59))
1315

1416
## [0.1.0]

packages/connect-evm/src/connect.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,10 @@ export class MetamaskConnectEVM {
459459
params,
460460
});
461461
await this.#trackWalletActionSucceeded(method, scope, params);
462+
if((result as unknown as { result: unknown }).result === null) {
463+
// result is successful we eagerly call onChainChanged to update the provider's selected chain ID.
464+
this.#onChainChanged(hexChainId);
465+
}
462466
return result;
463467
} catch (error) {
464468
await this.#trackWalletActionFailed(method, scope, params, error);

0 commit comments

Comments
 (0)