From 1dfc9c266c315d008fa19ee1b2e789d16c5209ab Mon Sep 17 00:00:00 2001 From: JustTemmie <47639983+JustTemmie@users.noreply.github.com> Date: Thu, 3 Jul 2025 20:29:15 +0200 Subject: [PATCH] feat: dynamically load pfp when uploading a new one --- components/Settings/UserSettings/Profile.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue index ed7da0a..0e648c6 100644 --- a/components/Settings/UserSettings/Profile.vue +++ b/components/Settings/UserSettings/Profile.vue @@ -31,6 +31,7 @@ import type { UserResponse } from '~/types/interfaces'; const { fetchUser } = useAuth(); + const user: UserResponse | undefined = await fetchUser() if (!user) { alert("could not fetch user info, aborting :(") @@ -90,7 +91,7 @@ async function changeAvatar() { newPfpFile = file const reader = new FileReader(); - reader.addEventListener("onload", () => { + reader.addEventListener("load", () => { if (reader.result && typeof reader.result === 'string') { user.avatar = reader.result; }