refactor: move yet more stuff into the popup component
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful
ci/woodpecker/pr/build-and-publish Pipeline was successful

This commit is contained in:
JustTemmie 2025-07-04 10:00:38 +02:00
parent d9c6faa6ab
commit 33dbcb5861
Signed by: justtemmie
SSH key fingerprint: SHA256:nBO+OwpTkd8LYhe38PIqdxmDvkIg9Vw2EbrRZM97dkU
2 changed files with 13 additions and 12 deletions

View file

@ -113,19 +113,11 @@ async function changeAvatar() {
}
function handleCrop(blob: Blob) {
function handleCrop(blob: Blob, url: string) {
if (!user) return;
user.avatar = url;
newPfpFile = new File([blob], 'avatar.png', { type: 'image/png' })
const reader = new FileReader();
reader.addEventListener("load", () => {
if (reader.result && typeof reader.result === 'string') {
user.avatar = reader.result;
}
});
reader.readAsDataURL(newPfpFile)
closeCropPopup()
}