Skip to content

Commit 129e029

Browse files
gaudrenSamWilsn
authored andcommitted
Fiddle with the order of connecting
1 parent 1de712c commit 129e029

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

client/src/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,6 @@ function main() {
289289
const open = spawn(async () => {
290290
webSocket?.removeEventListener("open", open);
291291

292-
await glue.activateChain({
293-
chainId: "0x" + chainId.toString(16),
294-
rpcUrl: rpcUrl.href,
295-
});
296-
297292
let requestAccountsPromise: unknown = null;
298293
const unsubscribe = glue.on("requestaccounts", (event) => {
299294
unsubscribe();
@@ -304,6 +299,15 @@ function main() {
304299
});
305300
});
306301

302+
if (baseProvider instanceof EthereumProvider) {
303+
await baseProvider.connect();
304+
}
305+
306+
await glue.activateChain({
307+
chainId: "0x" + chainId.toString(16),
308+
rpcUrl: rpcUrl.href,
309+
});
310+
307311
await unboundWallet.wallet.requestAddresses();
308312
unsubscribe();
309313
if (requestAccountsPromise instanceof Promise) {
@@ -385,7 +389,6 @@ function main() {
385389

386390
rpcMap: rpcMap,
387391
});
388-
await provider.connect();
389392

390393
await run(provider);
391394
}),

0 commit comments

Comments
 (0)