Skip to content

Commit

Permalink
fix:lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Maiqel1 committed Aug 13, 2024
1 parent 17f254a commit e46dcaf
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/app/dashboard/(admin)/admin/(settings)/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(".");
}
}
};
Expand Down

0 comments on commit e46dcaf

Please sign in to comment.