Detect federation testnet (#1193)

This commit is contained in:
KoalaSat 2024-03-19 16:02:46 +01:00 committed by GitHub
parent 10bc21d239
commit add5826a74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);