mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
Fix invite link when non-default language selected
This commit is contained in:
parent
e68dccbc17
commit
72a7759ca5
@ -30,7 +30,11 @@ export class DOMInvite implements Invite {
|
|||||||
get code(): string { return this._code; }
|
get code(): string { return this._code; }
|
||||||
set code(code: string) {
|
set code(code: string) {
|
||||||
this._code = code;
|
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;
|
const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement;
|
||||||
linkEl.textContent = code.replace(/-/g, '-');
|
linkEl.textContent = code.replace(/-/g, '-');
|
||||||
linkEl.href = this._codeLink;
|
linkEl.href = this._codeLink;
|
||||||
|
Loading…
Reference in New Issue
Block a user