Delete Account: added more unit tests

This commit is contained in:
gianantoniopini
2021-05-14 18:21:47 +02:00
parent d11d414504
commit a8cf553217
4 changed files with 98 additions and 47 deletions

View File

@ -66,8 +66,8 @@ const UserProvider = ({ children }) => {
}
};
const logout = () => {
firebase.auth().signOut();
const logout = async () => {
await firebase.auth().signOut();
localStorage.removeItem('user');
setUser(null);
navigate('/');
@ -123,7 +123,7 @@ const UserProvider = ({ children }) => {
} catch (error) {
toast.error(error.message);
} finally {
logout();
await logout();
toast(
"It's sad to see you go, but we respect your privacy. All your data has been deleted successfully. Hope to see you again soon!",
);