From e4b5843a426a1d405be050b869982679825e4585 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sat, 30 Dec 2023 12:27:27 +0000 Subject: [PATCH] Feat hide LocalDev coordinator conditionally --- frontend/src/models/Federation.model.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index ea85eaa4..7b47e541 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -8,6 +8,7 @@ import { defaultExchange, } from '.'; import defaultFederation from '../../static/federation.json'; +import { getHost } from '../utils'; import { updateExchangeInfo } from './Exchange.model'; type FederationHooks = 'onCoordinatorUpdate' | 'onFederationReady'; @@ -16,8 +17,13 @@ export class Federation { constructor() { this.coordinators = Object.entries(defaultFederation).reduce( (acc: Record, [key, value]: [string, any]) => { - acc[key] = new Coordinator(value); - return acc; + if (getHost() !== '127.0.0.1:8000' && key == 'local') { + // Do not add `Local Dev` unless it is running on localhost + return acc; + } else { + acc[key] = new Coordinator(value); + return acc; + } }, {}, );