diff --git a/backend/src/repositories/NodesSocketsRepository.ts b/backend/src/repositories/NodesSocketsRepository.ts index 8ddfafe68..9e2d28549 100644 --- a/backend/src/repositories/NodesSocketsRepository.ts +++ b/backend/src/repositories/NodesSocketsRepository.ts @@ -30,12 +30,13 @@ class NodesSocketsRepository { return 0; } try { + const placeholders = addresses.map(() => '?').join(','); const query = ` DELETE FROM nodes_sockets WHERE public_key = ? - AND socket NOT IN (${addresses.map(id => `"${id}"`).join(',')}) + AND socket NOT IN (${placeholders}) `; - const [result] = await DB.query(query, [publicKey]); + const [result] = await DB.query(query, [publicKey, ...addresses]); return result.affectedRows; } catch (e) { logger.err(`Cannot delete unused sockets for ${publicKey} from db. Reason: ` + (e instanceof Error ? e.message : e)); diff --git a/frontend/src/app/components/about/about-sponsors.component.html b/frontend/src/app/components/about/about-sponsors.component.html index 9471fc78f..02189acb6 100644 --- a/frontend/src/app/components/about/about-sponsors.component.html +++ b/frontend/src/app/components/about/about-sponsors.component.html @@ -1,14 +1,14 @@

If you're an individual...

- Become a Community Sponsor + Become a Community Sponsor

If you're a business...

- Become an Enterprise Sponsor + Become an Enterprise Sponsor diff --git a/frontend/src/app/components/about/about-sponsors.component.ts b/frontend/src/app/components/about/about-sponsors.component.ts index be86a9d93..673bb207c 100644 --- a/frontend/src/app/components/about/about-sponsors.component.ts +++ b/frontend/src/app/components/about/about-sponsors.component.ts @@ -1,5 +1,4 @@ import { Component, Input } from '@angular/core'; -import { EnterpriseService } from '@app/services/enterprise.service'; @Component({ selector: 'app-about-sponsors', @@ -10,17 +9,4 @@ import { EnterpriseService } from '@app/services/enterprise.service'; export class AboutSponsorsComponent { @Input() host = 'https://mempool.space'; @Input() context = 'about'; - - constructor(private enterpriseService: EnterpriseService) { - } - - onSponsorClick(e): boolean { - this.enterpriseService.goal(5); - return true; - } - - onEnterpriseClick(e): boolean { - this.enterpriseService.goal(6); - return true; - } } diff --git a/frontend/src/app/components/about/about.component.ts b/frontend/src/app/components/about/about.component.ts index 75b4cbbe0..211f21622 100644 --- a/frontend/src/app/components/about/about.component.ts +++ b/frontend/src/app/components/about/about.component.ts @@ -10,7 +10,6 @@ import { Router, ActivatedRoute } from '@angular/router'; import { map, share, tap } from 'rxjs/operators'; import { ITranslators } from '@interfaces/node-api.interface'; import { DOCUMENT } from '@angular/common'; -import { EnterpriseService } from '@app/services/enterprise.service'; import { ThemeService } from '../../services/theme.service'; @Component({ @@ -40,7 +39,6 @@ export class AboutComponent implements OnInit { private seoService: SeoService, private ogService: OpenGraphService, public stateService: StateService, - private enterpriseService: EnterpriseService, private apiService: ApiService, private router: Router, private route: ActivatedRoute, @@ -141,16 +139,6 @@ export class AboutComponent implements OnInit { this.promoVideo.nativeElement.muted = false; } - onSponsorClick(e): boolean { - this.enterpriseService.goal(5); - return true; - } - - onEnterpriseClick(e): boolean { - this.enterpriseService.goal(6); - return true; - } - get isLightMode(): boolean { return this.loadedTheme === 'nymkappa'; } diff --git a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts index 6f8636e96..618e52fe8 100644 --- a/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts +++ b/frontend/src/app/components/accelerate-checkout/accelerate-checkout.component.ts @@ -9,7 +9,6 @@ import { ETA, EtaService } from '@app/services/eta.service'; import { Transaction } from '@interfaces/electrs.interface'; import { MiningStats } from '@app/services/mining.service'; import { IAuth, AuthServiceMempool } from '@app/services/auth.service'; -import { EnterpriseService } from '@app/services/enterprise.service'; import { PartnerCodeService } from '@app/services/partner-code.service'; import { ApiService } from '@app/services/api.service'; import { isDevMode } from '@angular/core'; @@ -147,7 +146,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { private audioService: AudioService, private cd: ChangeDetectorRef, private authService: AuthServiceMempool, - private enterpriseService: EnterpriseService, private partnerCodeService: PartnerCodeService, private themeService: ThemeService, ) { @@ -236,7 +234,6 @@ export class AccelerateCheckout implements OnInit, OnDestroy { if (this._step === 'checkout') { this.insertSquare(); - this.enterpriseService.goal(8); this.scrollToElementWithTimeout('acceleratePreviewAnchor', 'start', 100); } diff --git a/frontend/src/app/components/privacy-policy/privacy-policy.component.html b/frontend/src/app/components/privacy-policy/privacy-policy.component.html index 89d5a8394..3c4c13935 100644 --- a/frontend/src/app/components/privacy-policy/privacy-policy.component.html +++ b/frontend/src/app/components/privacy-policy/privacy-policy.component.html @@ -43,7 +43,7 @@
-
  • We use a self-hosted statistics application (matomo) for analytics purposes, which collects your IP address along with the requests you make. Our matomo instance is configured to respect your privacy by redacting your IP address and other methods, and we do not share this data with any third-party. To conceal your activity from our analytics, we recommend that you use a privacy protecting browser extension that blocks matomo from being loaded.
  • +
  • We use a self-hosted statistics application for analytics purposes, which collects your IP address along with the requests you make. Our instance is configured to respect your privacy by redacting your IP address and other methods, and we do not share this data with any third-party. To conceal your activity from our analytics, we recommend that you use a privacy protecting browser extension that blocks it from being loaded.
  • diff --git a/frontend/src/app/components/tracker/tracker.component.ts b/frontend/src/app/components/tracker/tracker.component.ts index 7ad2817a7..6195161ce 100644 --- a/frontend/src/app/components/tracker/tracker.component.ts +++ b/frontend/src/app/components/tracker/tracker.component.ts @@ -167,8 +167,6 @@ export class TrackerComponent implements OnInit, OnDestroy { this.miningStats = stats; }); - this.enterpriseService.page(); - this.enterpriseInfo$ = this.enterpriseService.info$.subscribe(info => { this.enterpriseInfo = info; }); diff --git a/frontend/src/app/components/transaction/transaction.component.ts b/frontend/src/app/components/transaction/transaction.component.ts index 222c50f1b..365d9d48b 100644 --- a/frontend/src/app/components/transaction/transaction.component.ts +++ b/frontend/src/app/components/transaction/transaction.component.ts @@ -35,7 +35,6 @@ import { RelativeUrlPipe } from '@app/shared/pipes/relative-url/relative-url.pip import { PriceService } from '@app/services/price.service'; import { isFeatureActive } from '@app/bitcoin.utils'; import { ServicesApiServices } from '@app/services/services-api.service'; -import { EnterpriseService } from '@app/services/enterprise.service'; import { PartnerCodeService } from '@app/services/partner-code.service'; import { ZONE_SERVICE } from '@app/injection-tokens'; import { MiningService, MiningStats } from '@app/services/mining.service'; @@ -218,7 +217,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { private seoService: SeoService, private priceService: PriceService, private storageService: StorageService, - private enterpriseService: EnterpriseService, private partnerCodeService: PartnerCodeService, private miningService: MiningService, private etaService: EtaService, @@ -229,7 +227,6 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy { ngOnInit() { this.setupPartnerCode(); - this.enterpriseService.page(); this.isDetailsOpen = this.route.snapshot.queryParams['showDetails'] === 'true'; this.cpfpMode = this.route.snapshot.queryParams['cpfp'] === 'true'; diff --git a/frontend/src/app/services/enterprise.service.ts b/frontend/src/app/services/enterprise.service.ts index 350efa316..2dff81a20 100644 --- a/frontend/src/app/services/enterprise.service.ts +++ b/frontend/src/app/services/enterprise.service.ts @@ -3,7 +3,6 @@ import { Inject, Injectable } from '@angular/core'; import { ApiService } from '@app/services/api.service'; import { SeoService } from '@app/services/seo.service'; import { StateService } from '@app/services/state.service'; -import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject } from 'rxjs'; @Injectable({ @@ -12,8 +11,6 @@ import { BehaviorSubject } from 'rxjs'; export class EnterpriseService { exclusiveHostName = '.mempool.space'; subdomain: string | null = null; - statsUrl: string; - siteId: number; info$: BehaviorSubject = new BehaviorSubject(null); constructor( @@ -21,7 +18,6 @@ export class EnterpriseService { private apiService: ApiService, private seoService: SeoService, private stateService: StateService, - private activatedRoute: ActivatedRoute, ) { const subdomain = this.stateService.env.customize?.enterprise || this.document.location.hostname.indexOf(this.exclusiveHostName) > -1 && this.document.location.hostname.split(this.exclusiveHostName)[0] || false; @@ -30,8 +26,6 @@ export class EnterpriseService { this.fetchSubdomainInfo(); this.disableSubnetworks(); this.stateService.env.ACCELERATOR = false; - } else { - this.insertMatomo(); } } @@ -51,12 +45,10 @@ export class EnterpriseService { fetchSubdomainInfo(): void { if (this.stateService.env.customize?.branding) { const info = this.stateService.env.customize?.branding; - this.insertMatomo(info.site_id); this.seoService.setEnterpriseTitle(info.title, true); this.info$.next(this.processEnterpriseInfo(info)); } else { this.apiService.getEnterpriseInfo$(this.subdomain).subscribe((info) => { - this.insertMatomo(info.site_id); this.seoService.setEnterpriseTitle(info.title); this.info$.next(this.processEnterpriseInfo(info)); }, @@ -78,98 +70,4 @@ export class EnterpriseService { logoUrl, }; } - - insertMatomo(siteId?: number): void { - let statsUrl = '//stats.mempool.space/'; - - if (!siteId) { - switch (this.document.location.hostname) { - case 'mempool.space': - statsUrl = '//stats.mempool.space/'; - siteId = 5; - break; - case 'mempool.ninja': - statsUrl = '//stats.mempool.space/'; - siteId = 4; - break; - case 'liquid.network': - siteId = 8; - statsUrl = '//stats.liquid.network/'; - break; - case 'liquid.place': - siteId = 10; - statsUrl = '//stats.liquid.network/'; - break; - default: - return; - } - } - - this.statsUrl = statsUrl; - this.siteId = siteId; - - // @ts-ignore - if (window._paq && window['Matomo']) { - window['Matomo'].addTracker(statsUrl+'m.php', siteId.toString()); - const matomo = this.getMatomo(); - matomo.setDocumentTitle(this.seoService.getTitle()); - matomo.setCustomUrl(this.getCustomUrl()); - matomo.disableCookies(); - matomo.trackPageView(); - matomo.enableLinkTracking(); - } else { - // @ts-ignore - const alreadyInitialized = !!window._paq; - // @ts-ignore - const _paq = window._paq = window._paq || []; - _paq.push(['setDocumentTitle', this.seoService.getTitle()]); - _paq.push(['setCustomUrl', this.getCustomUrl()]); - _paq.push(['disableCookies']); - _paq.push(['trackPageView']); - _paq.push(['enableLinkTracking']); - if (alreadyInitialized) { - _paq.push(['addTracker', statsUrl+'m.php', siteId.toString()]); - } else { - (function() { - _paq.push(['setTrackerUrl', statsUrl+'m.php']); - _paq.push(['setSiteId', siteId.toString()]); - const d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; - // @ts-ignore - g.type='text/javascript'; g.async=true; g.src=statsUrl+'m.js'; s.parentNode.insertBefore(g,s); - })(); - } - } - } - - private getMatomo() { - if (this.siteId != null) { - return window['Matomo']?.getTracker(this.statsUrl+'m.php', this.siteId); - } - } - - goal(id: number) { - // @ts-ignore - this.getMatomo()?.trackGoal(id); - } - - page() { - const matomo = this.getMatomo(); - if (matomo) { - matomo.setCustomUrl(this.getCustomUrl()); - matomo.trackPageView(); - } - } - - private getCustomUrl(): string { - let url = window.location.origin + '/'; - let route = this.activatedRoute; - while (route) { - const segment = route?.routeConfig?.path; - if (segment && segment.length) { - url += segment + '/'; - } - route = route.firstChild; - } - return url; - } }