Fix undefined process error that may appear when using ui (#524)

This commit is contained in:
Nikos Kontakis
2021-10-13 18:38:49 +03:00
committed by GitHub
parent 633ca5fd2e
commit 196e851fa3
+1 -1
View File
@@ -53,7 +53,7 @@ export class Settings implements SettingsStruct {
this.#emitter = new EventEmitter(); this.#emitter = new EventEmitter();
// will become deprecated for supporting substrate connect light clients. apiType structure should be used instead // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead
this.#apiUrl = (typeof settings.apiUrl === 'string' && settings.apiUrl) || process.env.WS_URL || (ENDPOINT_DEFAULT.value as string); this.#apiUrl = (typeof settings.apiUrl === 'string' && settings.apiUrl) || (process && process.env && process.env.WS_URL) || (ENDPOINT_DEFAULT.value as string);
this.#apiType = { param: this.#apiUrl, type: 'json-rpc' as EndpointType }; this.#apiType = { param: this.#apiUrl, type: 'json-rpc' as EndpointType };
this.#camera = withDefault(CAMERA, settings.camera, CAMERA_DEFAULT); this.#camera = withDefault(CAMERA, settings.camera, CAMERA_DEFAULT);
this.#ledgerConn = withDefault(LEDGER_CONN, settings.ledgerConn, LEDGER_CONN_DEFAULT); this.#ledgerConn = withDefault(LEDGER_CONN, settings.ledgerConn, LEDGER_CONN_DEFAULT);