From 956c69eb297129cadd017e3a5074a95631770a01 Mon Sep 17 00:00:00 2001 From: regalijan Date: Thu, 19 Oct 2023 16:50:02 -0400 Subject: [PATCH] Don't check for BigInt support if user is logged in and has avatar set --- components/Navigation.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Navigation.tsx b/components/Navigation.tsx index 5669fb3..5ef2f57 100644 --- a/components/Navigation.tsx +++ b/components/Navigation.tsx @@ -27,12 +27,12 @@ async function destroySession() { function getAvatarUrl(userData: { [k: string]: any }): string { const BASE = "https://cdn.discordapp.com/"; - if (!userData.id || typeof window["BigInt"] === "undefined") return ""; + if (userData.avatar) + return BASE + `avatars/${userData.id}/${userData.avatar}`; - if (!userData.avatar) - return BASE + `embed/avatars/${(BigInt(userData.id) >> 22n) % 6n}.png`; + if (!userData.id || typeof window["BigInt"] === "undefined") return ""; - return BASE + `avatars/${userData.id}/${userData.avatar}`; + return BASE + `embed/avatars/${(BigInt(userData.id) >> 22n) % 6n}.png`; } export default function (props: {