From 5d402a56dae7be74a31501d0baeee09974157714 Mon Sep 17 00:00:00 2001 From: Andrei Eres Date: Mon, 29 Nov 2021 16:57:18 +0300 Subject: [PATCH] Fix raising error if process has not defined yet (#548) --- packages/ui-settings/src/Settings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui-settings/src/Settings.ts b/packages/ui-settings/src/Settings.ts index 839cb160..9ae449fe 100644 --- a/packages/ui-settings/src/Settings.ts +++ b/packages/ui-settings/src/Settings.ts @@ -53,7 +53,7 @@ export class Settings implements SettingsStruct { this.#emitter = new EventEmitter(); // will become deprecated for supporting substrate connect light clients. apiType structure should be used instead - this.#apiUrl = (typeof settings.apiUrl === 'string' && settings.apiUrl) || (process && process.env && process.env.WS_URL) || (ENDPOINT_DEFAULT.value as string); + this.#apiUrl = (typeof settings.apiUrl === 'string' && settings.apiUrl) || (typeof process === 'object' && process.env && process.env.WS_URL) || (ENDPOINT_DEFAULT.value as string); this.#apiType = { param: this.#apiUrl, type: 'json-rpc' as EndpointType }; this.#camera = withDefault(CAMERA, settings.camera, CAMERA_DEFAULT); this.#ledgerConn = withDefault(LEDGER_CONN, settings.ledgerConn, LEDGER_CONN_DEFAULT);