Skip to content

Commit

Permalink
SC.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Sep 18, 2023
1 parent 9261ec0 commit f87ffdb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/client/data/data-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@ class DataStore {
async connectSubstrateRPC() {
try {
// connection timeout handling
await setAsyncTimeout(async (done) => {
this.substrateClient = await ApiPromise.create({
provider: new WsProvider(this.network.rpcURL),
});
done(0);
return;
await setAsyncTimeout((done) => {
(async () => {
this.substrateClient = await ApiPromise.create({
provider: new WsProvider(this.network.rpcURL),
});
done(0);
})();
}, Constants.CONNECTION_TIMEOUT_MS);
this.eventBus.dispatch<string>(ChainvizEvent.SUBSTRATE_API_READY);
} catch (error) {
Expand Down

0 comments on commit f87ffdb

Please sign in to comment.