[partner] set code directly from subdomain#6459
Closed
nymkappa wants to merge 2 commits into
Closed
Conversation
f477fe1 to
632d816
Compare
632d816 to
22ef62d
Compare
Contributor
There was a problem hiding this comment.
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 toenterpriseService.info$, but this component already subscribes toinfo$inngOnInit(assigned toenterpriseInfo$) to populateenterpriseInfo. This duplicates work and introduces extra unsubscribe bookkeeping. Consider reusing the existingenterpriseInfo$subscription (or derivingpartnerCodewithin 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;
});
wiz
reviewed
Apr 22, 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}`, ''); |
Contributor
There was a problem hiding this comment.
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
Contributor
|
closing in favor of #6520 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves https://github.com/mempool/mempool.space/issues/2228