Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

Commit

Permalink
fix(configuration menu): let user override eth rpc url without servic…
Browse files Browse the repository at this point in the history
…e runner
  • Loading branch information
shanejonas committed Jun 30, 2019
1 parent fef2ec5 commit d0c83d2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/hooks/useMultiGeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ function useMultiGeth(serviceRunner: JadeServiceRunner | undefined, version: str
return;
}
const runAsync = async () => {
const installed = await serviceRunner.installService(serviceName, version);
if (!installed) { return; }
const service = await serviceRunner.startService(serviceName, version, env);
let defaultPort;
if (!url) {
const installed = await serviceRunner.installService(serviceName, version);
if (!installed) {
return;
}
const service = await serviceRunner.startService(serviceName, version, env);
defaultPort = service.rpcPort;
}
let parsedUrl;
try {
parsedUrl = new URL(url || `http://localhost:${service.rpcPort}`);
parsedUrl = new URL(url || `http://localhost:${defaultPort}`);
} catch (e) {
return;
}
Expand Down

0 comments on commit d0c83d2

Please sign in to comment.