Skip to content

Commit

Permalink
fix: toast alteração de email
Browse files Browse the repository at this point in the history
  • Loading branch information
ialexanderbrito committed Apr 9, 2022
1 parent 8afe4f2 commit 3113374
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/hooks/useProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ export function useProfile() {
return;
}

toast.success('Perfil atualizado com sucesso', { id: 'toast' });
setLoading(false);
setUser(userData);
if (formikProfile.values.email !== userData.email) {
toast.success('Verifique a sua caixa de entrada para confirmar a mudança de email', { id: 'toast' });
setLoading(false);
} else {
toast.success('Perfil atualizado com sucesso', { id: 'toast' });
setLoading(false);
setUser(userData);
}
},
});

Expand Down

0 comments on commit 3113374

Please sign in to comment.