Removed unnecessary timeout and replaced Promise.then()
This commit is contained in:
1 parent
bd5ed007eb
commit
85a2177f1d
2 files changed
+6
-10
No files matched your search
@@ -183,13 +183,12 @@ const ProfilePanel = () => {
|
||||
};
|
||||
|
||||
// Initiates the account deletion process
|
||||
const handleDeleteAccount = () => {
|
||||
dispatch(deleteUser(authToken)).then((action) => {
|
||||
if (action.payload.success) {
|
||||
dispatch(clearAuthState());
|
||||
dispatch(clearMonitorState());
|
||||
}
|
||||
});
|
||||
const handleDeleteAccount = async () => {
|
||||
const action = await dispatch(deleteUser(authToken));
|
||||
if (action.payload.success) {
|
||||
dispatch(clearAuthState());
|
||||
dispatch(clearMonitorState());
|
||||
}
|
||||
};
|
||||
|
||||
// Modal state and control functions
|
||||
|
||||
Reference in new issue
Block a user