Skip to content

Commit

Permalink
fixed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JamalAlabdullah committed Jul 5, 2024
1 parent 6221094 commit 85d1b87
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions frontend/packages/shared/src/contexts/ServicesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,15 @@ const handleError = (
const errorCode = error?.response?.data?.errorCode;
const unAuthorizedErrorCode = error?.response?.status === ServerCodes.Unauthorized;

const LogOutUser = () => {
logout().then(() => window.location.assign(userLogoutAfterPath()));
};
const LogOutUser = () => logout().then(() => window.location.assign(userLogoutAfterPath()));

if (unAuthorizedErrorCode) {
renderToast(errorCode || 'Unauthorized', {
onClose: LogOutUser,
autoClose: LOG_OUT_TIMER_MS,
});
setTimeout(() => {
logout().then(() => window.location.assign(userLogoutAfterPath()));
LogOutUser();
}, LOG_OUT_TIMER_MS);
return;
}
Expand Down

0 comments on commit 85d1b87

Please sign in to comment.