From a5c1ac9680b63ff47cacd6aa34fded311d0a51cf Mon Sep 17 00:00:00 2001 From: Carlos Daniel Vilaseca Date: Sun, 3 Mar 2024 17:32:04 -0500 Subject: [PATCH] rf: dom queries in Account component --- src/lib/components/chat/Settings/Account.svelte | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/components/chat/Settings/Account.svelte b/src/lib/components/chat/Settings/Account.svelte index 66d10733..98f4aa17 100644 --- a/src/lib/components/chat/Settings/Account.svelte +++ b/src/lib/components/chat/Settings/Account.svelte @@ -15,6 +15,7 @@ let name = ''; let showJWTToken = false; let JWTTokenCopied = false; + let profileImageInputElement: HTMLInputElement; const submitHandler = async () => { const updatedUser = await updateUserProfile(localStorage.token, name, profileImageUrl).catch( @@ -40,11 +41,12 @@
{ - const files = e?.target?.files ?? []; + const files = profileImageInputElement.files ?? []; let reader = new FileReader(); reader.onload = (event) => { let originalImageUrl = `${event.target.result}`; @@ -86,7 +88,7 @@ // Display the compressed image profileImageUrl = compressedSrc; - e.target.files = null; + profileImageInputElement.files = null; }; }; @@ -107,9 +109,7 @@