1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-23 01:20:11 +00:00

account for lack of trailing slash in url

This commit is contained in:
Harvey Tindall 2021-02-09 20:45:35 +00:00
parent 173c38563e
commit 192c9a4764
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
2 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,7 @@ for (let tab of ["invites", "accounts", "settings"]) {
} }
} }
if (window.location.pathname == window.URLBase + "/") { if ((window.URLBase + "/").includes(window.location.pathname)) {
window.tabs.switch("invites", true); window.tabs.switch("invites", true);
} }

View File

@ -45,6 +45,7 @@ export class DOMInvite implements Invite {
for (let split of ["#", "?"]) { for (let split of ["#", "?"]) {
codeLink = codeLink.split(split)[0]; codeLink = codeLink.split(split)[0];
} }
if (codeLink.slice(0, -1) != "/") { codeLink += "/"; }
this._codeLink = codeLink + "invite/" + code; this._codeLink = codeLink + "invite/" + code;
const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement; const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement;
if (this.label == "") { if (this.label == "") {