Fix invite link when non-default language selected

pull/61/head
Harvey Tindall 4 years ago
parent e68dccbc17
commit 72a7759ca5
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -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;

Loading…
Cancel
Save