From add5826a7419d1c7735162a6434f84706e3fdace Mon Sep 17 00:00:00 2001 From: KoalaSat Date: Tue, 19 Mar 2024 16:02:46 +0100 Subject: [PATCH] Detect federation testnet (#1193) --- frontend/src/models/Federation.model.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/models/Federation.model.ts b/frontend/src/models/Federation.model.ts index 25e95b78..4b26623c 100644 --- a/frontend/src/models/Federation.model.ts +++ b/frontend/src/models/Federation.model.ts @@ -75,8 +75,17 @@ export class Federation { this.exchange.onlineCoordinators = this.exchange.onlineCoordinators + 1; this.onCoordinatorSaved(); }; + this.loading = true; this.exchange.loadingCoordinators = Object.keys(this.coordinators).length; + + const host = getHost(); + const url = `${window.location.protocol}//${host}`; + const tesnetHost = Object.values(this.coordinators).find((coor) => { + return Object.values(coor.testnet).includes(url); + }); + if (tesnetHost) settings.network = 'testnet'; + for (const coor of Object.values(this.coordinators)) { if (coor.enabled) { await coor.start(origin, settings, hostUrl, onCoordinatorStarted);