Fixing broken Matomo och bisq and liquid

This commit is contained in:
softsimon 2022-08-12 13:27:43 +04:00
parent 6cba4a8492
commit 329e9aa034
No known key found for this signature in database
GPG key ID: 488D7DCFB5A430D7

View file

@ -24,16 +24,16 @@ export class EnterpriseService {
this.subdomain = subdomain; this.subdomain = subdomain;
this.fetchSubdomainInfo(); this.fetchSubdomainInfo();
this.disableSubnetworks(); this.disableSubnetworks();
} else if (document.location.hostname === 'mempool.space') { } else {
this.insertMatomo(); this.insertMatomo();
} }
} }
getSubdomain() { getSubdomain(): string {
return this.subdomain; return this.subdomain;
} }
disableSubnetworks() { disableSubnetworks(): void {
this.stateService.env.TESTNET_ENABLED = false; this.stateService.env.TESTNET_ENABLED = false;
this.stateService.env.LIQUID_ENABLED = false; this.stateService.env.LIQUID_ENABLED = false;
this.stateService.env.LIQUID_TESTNET_ENABLED = false; this.stateService.env.LIQUID_TESTNET_ENABLED = false;
@ -41,7 +41,7 @@ export class EnterpriseService {
this.stateService.env.BISQ_ENABLED = false; this.stateService.env.BISQ_ENABLED = false;
} }
fetchSubdomainInfo() { fetchSubdomainInfo(): void {
this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => { this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => {
this.info = info; this.info = info;
this.insertMatomo(info.site_id); this.insertMatomo(info.site_id);
@ -54,14 +54,20 @@ export class EnterpriseService {
}); });
} }
insertMatomo(siteId = 5) { insertMatomo(siteId?: number): void {
let statsUrl = '//stats.mempool.space/'; let statsUrl = '//stats.mempool.space/';
if (this.document.location.hostname === 'liquid.network') {
statsUrl = '//stats.liquid.network/'; if (!siteId) {
siteId = 8; siteId = 5;
} else if (this.document.location.hostname === 'bisq.markets') { if (this.document.location.hostname === 'liquid.network') {
statsUrl = '//stats.bisq.markets/'; statsUrl = '//stats.liquid.network/';
siteId = 7; siteId = 8;
} else if (this.document.location.hostname === 'bisq.markets') {
statsUrl = '//stats.bisq.markets/';
siteId = 7;
} else if (this.document.location.hostname !== 'mempool.space') {
return;
}
} }
// @ts-ignore // @ts-ignore