@cartridge/controller 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartridge/controller",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "Cartridge Controller",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "vite-plugin-node-polyfills": "^0.23.0",
51
51
  "vite-plugin-top-level-await": "^1.4.4",
52
52
  "vite-plugin-wasm": "^3.4.1",
53
- "@cartridge/tsconfig": "0.10.1"
53
+ "@cartridge/tsconfig": "0.10.2"
54
54
  },
55
55
  "scripts": {
56
56
  "build:deps": "pnpm build",
package/src/controller.ts CHANGED
@@ -206,17 +206,14 @@ export default class ControllerProvider extends BaseProvider {
206
206
  return false;
207
207
  }
208
208
 
209
+ const currentChain = this.selectedChain;
210
+
209
211
  try {
210
212
  this.selectedChain = chainId;
211
- const response = (await this.keychain.probe(this.rpcUrl())) as ProbeReply;
212
-
213
- if (response.rpcUrl === this.rpcUrl()) {
214
- return true;
215
- }
216
-
217
213
  await this.keychain.switchChain(this.rpcUrl());
218
214
  } catch (e) {
219
215
  console.error(e);
216
+ this.selectedChain = currentChain;
220
217
  return false;
221
218
  }
222
219