Skip to content

Commit

Permalink
fix(invites): correctly use vanityURL cache
Browse files Browse the repository at this point in the history
  • Loading branch information
reboxer committed Dec 23, 2019
1 parent 4b98f82 commit f766bda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/invites/commands/invites/inviteCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export default class extends Command {
isWidget: !code.inviter
}));

const vanityInv = guild.vanityURL || (await guild.getVanity().catch(() => undefined));
const vanityInv =
(guild.vanityURL ? { code: guild.vanityURL } : false) || (await guild.getVanity().catch(() => undefined));
if (vanityInv && vanityInv.code) {
newDbCodes.push({
code: vanityInv.code,
Expand Down
3 changes: 2 additions & 1 deletion src/invites/services/Tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ export class TrackingService {
// Collect concurrent promises
const promises: any[] = [];

const vanityInv = guild.vanityURL || (await guild.getVanity().catch(() => undefined));
const vanityInv =
(guild.vanityURL ? { code: guild.vanityURL } : false) || (await guild.getVanity().catch(() => undefined));
if (vanityInv && vanityInv.code) {
newInviteCodes.push({
code: vanityInv.code,
Expand Down

0 comments on commit f766bda

Please sign in to comment.