mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-21 20:59:01 +00:00
Feat hide LocalDev coordinator conditionally
This commit is contained in:
parent
138d5cabf9
commit
e4b5843a42
@ -8,6 +8,7 @@ import {
|
|||||||
defaultExchange,
|
defaultExchange,
|
||||||
} from '.';
|
} from '.';
|
||||||
import defaultFederation from '../../static/federation.json';
|
import defaultFederation from '../../static/federation.json';
|
||||||
|
import { getHost } from '../utils';
|
||||||
import { updateExchangeInfo } from './Exchange.model';
|
import { updateExchangeInfo } from './Exchange.model';
|
||||||
|
|
||||||
type FederationHooks = 'onCoordinatorUpdate' | 'onFederationReady';
|
type FederationHooks = 'onCoordinatorUpdate' | 'onFederationReady';
|
||||||
@ -16,8 +17,13 @@ export class Federation {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.coordinators = Object.entries(defaultFederation).reduce(
|
this.coordinators = Object.entries(defaultFederation).reduce(
|
||||||
(acc: Record<string, Coordinator>, [key, value]: [string, any]) => {
|
(acc: Record<string, Coordinator>, [key, value]: [string, any]) => {
|
||||||
acc[key] = new Coordinator(value);
|
if (getHost() !== '127.0.0.1:8000' && key == 'local') {
|
||||||
return acc;
|
// Do not add `Local Dev` unless it is running on localhost
|
||||||
|
return acc;
|
||||||
|
} else {
|
||||||
|
acc[key] = new Coordinator(value);
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user