Skip to content

Commit

Permalink
bug: fix closing modal
Browse files Browse the repository at this point in the history
  • Loading branch information
p6te committed Jan 2, 2024
1 parent fd9684b commit 0b8904d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/UserSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ export default function UserSettings({ setIsLoading, onClose }: Props) {
if (errors.username) {
return;
}
setIsLoading(true);

const values = getValues();

if (
(imageURL !== "" ||
values.username !== (loggedUser?.displayName as string)) &&
!!loggedUser.displayName
) {
setIsLoading(true);
try {
const date = new Date().getTime();
const storageRef = ref(
Expand Down Expand Up @@ -114,6 +115,8 @@ export default function UserSettings({ setIsLoading, onClose }: Props) {
// TODO Send to error page
alert(error.message);
}
} else {
onClose();
}
};

Expand Down

0 comments on commit 0b8904d

Please sign in to comment.