From babb6a48ad5dd2e6154908995a5583141c64eef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Leszczyk?= Date: Thu, 14 Apr 2022 18:33:39 +0200 Subject: [PATCH] ops(dashboard-v2): fix SkynetClient on multi-server portals --- packages/dashboard-v2/src/services/skynetClient.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/dashboard-v2/src/services/skynetClient.js b/packages/dashboard-v2/src/services/skynetClient.js index a01e96f9..cb236ade 100644 --- a/packages/dashboard-v2/src/services/skynetClient.js +++ b/packages/dashboard-v2/src/services/skynetClient.js @@ -1,3 +1,6 @@ import { SkynetClient } from "skynet-js"; -export default new SkynetClient(`https://${process.env.GATSBY_PORTAL_DOMAIN}`); +const { NODE_ENV, GATSBY_PORTAL_DOMAIN } = process.env; + +// In production-like environment, let SkynetClient figure out the best portal +export default new SkynetClient(NODE_ENV === "development" ? `https://${GATSBY_PORTAL_DOMAIN}` : undefined);