config: add http:// to all urls if needed, fix invite link generation
changed invites.ts to generate links using window.Pages entirely, rather than chopping up window.location.href.
This commit is contained in:
@@ -48,16 +48,6 @@ export class Activity implements activity, SearchableItem {
|
||||
private _delete: HTMLElement;
|
||||
private _ip: HTMLElement;
|
||||
private _act: activity;
|
||||
/* private _urlBase: string = ((): string => {
|
||||
let link = window.location.href;
|
||||
for (let split of ["#", "?", "/activity"]) {
|
||||
link = link.split(split)[0];
|
||||
}
|
||||
if (link.slice(-1) != "/") { link += "/"; }
|
||||
// FIXME: I should probably just be using window.pages.Base, but incase thats not right, i'll put this warning here
|
||||
if (link != window.pages.Base) console.error(`URL Bases don't match: "${link}" != "${window.pages.Base}"`);
|
||||
return link;
|
||||
})(); */
|
||||
|
||||
_genUserText = (): string => {
|
||||
return `<span class="font-medium">${this._act.username || this._act.user_id.substring(0, 5)}</span>`;
|
||||
|
||||
@@ -63,12 +63,7 @@ class DOMInvite implements Invite {
|
||||
get code(): string { return this._code; }
|
||||
set code(code: string) {
|
||||
this._code = code;
|
||||
let codeLink = window.location.href;
|
||||
for (let split of ["#", "?"]) {
|
||||
codeLink = codeLink.split(split)[0];
|
||||
}
|
||||
if (codeLink.slice(-1) != "/") { codeLink += "/"; }
|
||||
this._codeLink = codeLink + window.pages.Form + "/" + code;
|
||||
this._codeLink = window.pages.Base + window.pages.Form + "/" + code;
|
||||
const linkEl = this._codeArea.querySelector("a") as HTMLAnchorElement;
|
||||
if (this.label == "") {
|
||||
linkEl.textContent = code.replace(/-/g, '-');
|
||||
|
||||
Reference in New Issue
Block a user