feat: dynamically load pfp when uploading a new one
This commit is contained in:
parent
0565964b1b
commit
1dfc9c266c
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue