From 4067f38b4c768fd0877a12237640674eba0e37ac Mon Sep 17 00:00:00 2001 From: alexa Date: Sat, 1 Jun 2024 17:15:21 +0200 Subject: [PATCH] small fixes --- ui/components/pages/profile.mjs | 2 +- ui/components/pages/register.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/components/pages/profile.mjs b/ui/components/pages/profile.mjs index 66a5bfd..09c3a17 100644 --- a/ui/components/pages/profile.mjs +++ b/ui/components/pages/profile.mjs @@ -87,7 +87,7 @@ export class ProfileComponent { input.onchange = () => { const reader = new FileReader(); reader.onload = () => { - const base64 = reader.result.split(',')[1]; + const base64 = reader.result.toString(); avatar.value = base64; Api.updateAvatar(base64).then((res) => { if (res.status !== 200) { diff --git a/ui/components/pages/register.mjs b/ui/components/pages/register.mjs index 8e5bdd0..5a937ec 100644 --- a/ui/components/pages/register.mjs +++ b/ui/components/pages/register.mjs @@ -104,7 +104,7 @@ export class RegisterComponent { toast("Registration successful", "positive"); window.router.navigate("chat"); } else { - toast("Registration failed", "negative"); + toast("Registration failed: " + res.data.error, "negative"); } }).catch(() => { loading.value = false;