Fix referral url when subdomain contains `account`

This fix should work to grab the base url more consistently when the sub domain includes `account` in the name.
pull/347/head
jeppevinkel 6 months ago committed by GitHub
parent a7529c7498
commit acfdcdbc63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -267,9 +267,8 @@ class ReferralCard {
set code(c: string) {
this._code = c;
let url = window.location.href;
for (let split of ["#", "?", "account", "my"]) {
url = url.split(split)[0];
}
let pathArray = url.split('/');
url = `${pathArray[0]}//${pathArray[2]}/`;
if (url.slice(-1) != "/") { url += "/"; }
url = url + "invite/" + this._code;
this._url = url;

Loading…
Cancel
Save