From 471021623b0380a1e50119700481ae5df7a6583d Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Wed, 14 May 2025 22:55:34 +0100 Subject: [PATCH] userpage: fix invite code gen as the admin page, use window.pages to generate link entirely. --- ts/user.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ts/user.ts b/ts/user.ts index e087066..07bee29 100644 --- a/ts/user.ts +++ b/ts/user.ts @@ -303,14 +303,10 @@ class ReferralCard { get code(): string { return this._code; } set code(c: string) { this._code = c; - + + let u = new URL(window.location.href); - let path = u.pathname; - for (let split of ["account", "my"]) { - path = path.split(split)[0]; - } - if (path.slice(-1) != "/") { path += "/"; } - path = path + window.pages.Form + "/" + this._code; + const path = window.pages.Base + window.pages.Form + "/" + this._code; u.pathname = path; u.hash = "";