Added homepage redirect when logout
This commit is contained in:
@@ -69,6 +69,12 @@ export default function NavBar() {
|
||||
setLoginOpen(true);
|
||||
} else if (link === 'logout') {
|
||||
logout();
|
||||
if (
|
||||
location.pathname.startsWith('/account') ||
|
||||
location.pathname.startsWith('/orders')
|
||||
) {
|
||||
navigate('/');
|
||||
}
|
||||
} else {
|
||||
navigate(`/${link.toLowerCase()}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user