From 72a7759ca528352b69fa57de85c883aa972fde77 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 17 Jan 2021 12:36:16 +0000 Subject: [PATCH] Fix invite link when non-default language selected --- ts/modules/invites.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/modules/invites.ts b/ts/modules/invites.ts index 1d05475..9a2080a 100644 --- a/ts/modules/invites.ts +++ b/ts/modules/invites.ts @@ -30,7 +30,11 @@ export class DOMInvite implements Invite { get code(): string { return this._code; } set code(code: string) { this._code = code; - this._codeLink = window.location.href.split("#")[0] + "invite/" + code; + let codeLink = window.location.href; + for (let split of ["#", "?"]) { + codeLink = codeLink.split(split)[0]; + } + this._codeLink = codeLink + "invite/" + code; const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement; linkEl.textContent = code.replace(/-/g, '-'); linkEl.href = this._codeLink;