From e46dcaf74b2c3944a3c5ca29119648481bba71e2 Mon Sep 17 00:00:00 2001 From: maiqel Date: Tue, 13 Aug 2024 12:41:55 +0100 Subject: [PATCH] fix:lint issues --- .../(admin)/admin/(settings)/settings/page.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx b/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx index 81f54d9f0..71f077ab9 100644 --- a/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx +++ b/src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx @@ -133,26 +133,18 @@ export default function SettingsPage() { if (uploadResponse.status === 200) { const { avatar_url, profile_pic_url } = uploadResponse.data.data; const profilePicUrl = avatar_url || profile_pic_url; - window.dispatchEvent( - new CustomEvent("userProfileUpdate", { detail: { profilePicUrl } }), - ); + setProfilePicture(profilePicUrl); setFormData((previousData) => ({ ...previousData, profile_pic_url: profilePicture, })); - window.dispatchEvent(new Event("profileUpdate")); } else { - throw new Error("Failed to upload image"); + throw new Error("."); } } catch { - setError("Error during Image upload"); - toast({ - title: "Error", - description: "Failed to update profile picture. Please try again.", - variant: "destructive", - }); + setError("."); } } };