web/satellite: pass query param on satellite switch in signup form

If "partner" query param is set on signup screen we pass it on satellite switch.

Issue: https://github.com/storj/storj/issues/4955

Change-Id: I59039d6ae660d8790390e59650de0ce1e3bba1b4
This commit is contained in:
Vitalii 2022-07-01 15:51:51 +03:00 committed by Maximillian von Briesen
parent 87e1528104
commit 08120d1445

View File

@ -42,7 +42,7 @@
v-for="(sat, index) in partneredSatellites" v-for="(sat, index) in partneredSatellites"
:key="index" :key="index"
class="register-area__input-area__expand__dropdown__item" class="register-area__input-area__expand__dropdown__item"
:href="`${sat.address}/signup`" :href="sat.address"
> >
{{ sat.name }} {{ sat.name }}
</a> </a>
@ -321,10 +321,10 @@ export default class RegisterArea extends Vue {
public readonly analytics: AnalyticsHttpApi = new AnalyticsHttpApi(); public readonly analytics: AnalyticsHttpApi = new AnalyticsHttpApi();
/** /**
* Lifecycle hook after initial render. * Lifecycle hook before initial render.
* Sets up variables from route params. * Sets up variables from route params.
*/ */
public mounted(): void { public beforeMount(): void {
if (this.$route.query.token) { if (this.$route.query.token) {
this.secret = this.$route.query.token.toString(); this.secret = this.$route.query.token.toString();
} }
@ -433,7 +433,16 @@ export default class RegisterArea extends Vue {
* Information about partnered satellites, including name and signup link. * Information about partnered satellites, including name and signup link.
*/ */
public get partneredSatellites(): PartneredSatellite[] { public get partneredSatellites(): PartneredSatellite[] {
return this.$store.state.appStateModule.partneredSatellites; const satellites = this.$store.state.appStateModule.partneredSatellites;
return satellites.map((s: PartneredSatellite) => {
s.address = `${s.address}/signup`;
if (this.user.partner) {
s.address = `${s.address}?partner=${this.user.partner}`;
}
return s;
})
} }
/** /**