Skip to content

[partner] set code directly from subdomain#6459

Closed
nymkappa wants to merge 2 commits into
masterfrom
nymkappa/parnter-code-subdomain
Closed

[partner] set code directly from subdomain#6459
nymkappa wants to merge 2 commits into
masterfrom
nymkappa/parnter-code-subdomain

Conversation

@nymkappa

@nymkappa nymkappa commented Apr 8, 2026

Copy link
Copy Markdown
Member

This comment was marked as resolved.

@nymkappa nymkappa force-pushed the nymkappa/parnter-code-subdomain branch from f477fe1 to 632d816 Compare April 8, 2026 02:49
@nymkappa nymkappa requested a review from Copilot April 8, 2026 02:50

This comment was marked as resolved.

@nymkappa nymkappa force-pushed the nymkappa/parnter-code-subdomain branch from 632d816 to 22ef62d Compare April 8, 2026 03:20
@nymkappa nymkappa requested a review from Copilot April 8, 2026 03:20

This comment was marked as outdated.

@nymkappa nymkappa requested a review from Copilot April 8, 2026 03:53
@nymkappa nymkappa marked this pull request as ready for review April 8, 2026 03:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

frontend/src/app/components/tracker/tracker.component.ts:170

  • setupPartnerCode() adds a second subscription to enterpriseService.info$, but this component already subscribes to info$ in ngOnInit (assigned to enterpriseInfo$) to populate enterpriseInfo. This duplicates work and introduces extra unsubscribe bookkeeping. Consider reusing the existing enterpriseInfo$ subscription (or deriving partnerCode within it) instead of creating another subscription.
    this.setupPartnerCode();

    this.acceleratorAvailable = this.stateService.env.OFFICIAL_MEMPOOL_SPACE && this.stateService.env.ACCELERATOR && this.stateService.network === '';

    this.miningService.getMiningStats('1w').subscribe(stats => {
      this.miningStats = stats;
    });

    this.enterpriseService.page();

    this.enterpriseInfo$ = this.enterpriseService.info$.subscribe(info => {
      this.enterpriseInfo = info;
    });

@nymkappa nymkappa self-assigned this Apr 19, 2026
@nymkappa nymkappa requested a review from mononaut April 19, 2026 05:08
@nymkappa nymkappa assigned mononaut and unassigned nymkappa Apr 19, 2026
if (this.partnerCode) {
this.storageService.setValue('partnerCode', this.partnerCode);
// Prevents the same partner code from being re-applied upon reloading the page
window.location.hash = window.location.hash.replace(`&partnerCode=${this.partnerCode}`, '').replace(`#partnerCode=${this.partnerCode}`, '');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mononaut is this ok?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mononaut is this ok? ❤️

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize this pattern was pre-existing, but no not really - directly manipulating the window.location.hash conflicts with Angular Router state. also, as written, if partnerCode is the first of multiple fragment params this breaks the URL.

I think the correct approach requires a slightly deeper refactor, so I've opened a separate PR which also includes this code-from-subdomain feature: #6520

@mononaut mononaut removed their assignment May 21, 2026
@mononaut

Copy link
Copy Markdown
Contributor

closing in favor of #6520

@mononaut mononaut closed this May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants