This commit is contained in:
2025-11-14 22:55:59 +05:30
parent 3e1ec9a3ed
commit 7faedcf2f9

View File

@@ -28,7 +28,7 @@ export default function Profile({ onBack }: ProfileProps) {
const [saving, setSaving] = React.useState(false);
React.useEffect(() => {
if (currentUser) setFormData(currentUser);
if (currentUser) setFormData(currentUser);
}, [currentUser]);
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@@ -44,8 +44,6 @@ export default function Profile({ onBack }: ProfileProps) {
setSuccess(null);
const updatedUser = { ...currentUser, ...formData };
console.log('updatedUser');
console.log(updatedUser);
const updated = await updateProfile(updatedUser);
if (updated) setSuccess('Profile updated successfully');
@@ -57,8 +55,8 @@ export default function Profile({ onBack }: ProfileProps) {
};
const handleLogout = async () => {
logout()
}
logout();
};
if (!currentUser) {
return (