userpage: fix invite code gen

as the admin page, use window.pages to generate link entirely.
This commit is contained in:
Harvey Tindall
2025-05-14 22:55:34 +01:00
parent e7f4de2202
commit 471021623b
+2 -6
View File
@@ -304,13 +304,9 @@ class ReferralCard {
set code(c: string) { set code(c: string) {
this._code = c; this._code = c;
let u = new URL(window.location.href); let u = new URL(window.location.href);
let path = u.pathname; const path = window.pages.Base + window.pages.Form + "/" + this._code;
for (let split of ["account", "my"]) {
path = path.split(split)[0];
}
if (path.slice(-1) != "/") { path += "/"; }
path = path + window.pages.Form + "/" + this._code;
u.pathname = path; u.pathname = path;
u.hash = ""; u.hash = "";