From 168b2175536d95f6ce75ee40dd5cdadaa734b17a Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 23 May 2021 14:32:35 +0100 Subject: [PATCH] Discord: fix user links --- ts/modules/accounts.ts | 2 ++ ts/modules/invites.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/ts/modules/accounts.ts b/ts/modules/accounts.ts index 6beb081..a0ae57a 100644 --- a/ts/modules/accounts.ts +++ b/ts/modules/accounts.ts @@ -280,6 +280,7 @@ class user implements User { get discord_id(): string { return this._discordID; } set discord_id(id: string) { + if (!window.discordEnabled || this._discordUsername == "") return; this._discordID = id; const link = this._discord.getElementsByClassName("discord-link")[0] as HTMLAnchorElement; link.href = `https://discord.com/users/${id}`; @@ -466,6 +467,7 @@ class user implements User { this.notify_telegram = user.notify_telegram; this.notify_discord = user.notify_discord; this.notify_email = user.notify_email; + this.discord_id = user.discord_id; } asElement = (): HTMLTableRowElement => { return this._row; } diff --git a/ts/modules/invites.ts b/ts/modules/invites.ts index 4645755..ea7fff3 100644 --- a/ts/modules/invites.ts +++ b/ts/modules/invites.ts @@ -1,4 +1,5 @@ import { _get, _post, _delete, toClipboard, toggleLoader, toDateString } from "../modules/common.js"; +import { newDiscordSearch } from "../modules/discord.js"; class DOMInvite implements Invite { updateNotify = (checkbox: HTMLInputElement) => {