Skip to content

Commit

Permalink
Don't show avatar if null, redirect to settings on login
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Nov 27, 2023
1 parent cb99b78 commit 61fb9d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/CurrentAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export default function CurrentAccount() {
<li>
<details role="list">
<summary aria-haspopup="listbox" role="link" className="currentAccount">
<img
src={`https://cdn.discordapp.com/avatars/${cachedMe.id}/${cachedMe.avatar}.png`}
alt={cachedMe.username}
/>
{cachedMe.avatar != null && (
<img
src={`https://cdn.discordapp.com/avatars/${cachedMe.id}/${cachedMe.avatar}.png`}
alt={cachedMe.username}
/>
)}

{cachedMe.username}
</summary>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/Redirect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function Redirect() {
}, []);

if (result != null && !result.error) {
navigate("/");
navigate("/settings");
}

return result == null ? (
Expand Down

0 comments on commit 61fb9d5

Please sign in to comment.